first function
def count_of_vowels(string):
count=0
vowels=["a","e","i","o","u","A","I","O","U","E"]
for ch in string:
if ch in vowels:
count+=1
return count
output
Circle function
def circle(diameter):
pi=3.1415
area=0
area=pi*(diameter/2)*(diameter/2)
return area
output
Case Switcher
code
def case_switcher(string):
output=""
for ch in string:
if(ch.isupper()):
output+=ch.lower()
elif(ch.islower()):
output+=ch.upper()
else:
output+=ch
return output
output
list1_minus_list2
code
def list1_minus_list2(list1,list2):
output=[]
for item in list1:
if item not in list2:
output.append(item)
return output
output
integer_n(n)
code
def integer_n(n):
output=0
while (n < 999):
output+=n
n=n*10+n
return output
output
If you have any query
regarding the code please ask me in the comment i am here for help
you. Please do not direct thumbs down just ask if you have any
query. And if you like my work then please appreciates with up
vote. Thank You.
e Computer Science question! Chex 즐 Untitled C localhost:8888/notebooks/Untitledipynb?kernel-name-python3 : Apps e Types Of Informatio.. 凸 Inbox (2.393)-Jose )Subtitles me-Narcos aOverloading Minus.. < c++-Rational Nu.. jupyter Untitled Last Checkpoint 3 minutes ago (unsaved changes) Logout File Edit View Insert CellKe Widgets Help Trusted ! Python 3。 In [2]: def count_of_vowels(string): count-e vowels-["a","e","i","o","u","A",ד.. , "o","U" , "E"] for ch in string: if ch in vowels: count+ 1 return count In [3]: print(count-of-vowels("My name is jay")) 4 O Type here to search rP ^ (AD4, ENG 17-03-2019号
In [4]: def circle(diameter): pi-3.1415 area-0 area-pi (diameter/2) (diameter/2) return area In [5: print"Area:".circle(10)) Area: 7853.7588ee680001 In [ J:
In [3]: def case suitcher(string) output- for ch in string if(ch.isupper)): elif(ch.islower()): else: output+-ch.lower() output+-ch.upper() output+-ch return output In [4]:print(case_switcher("Hello Word")) ELLO WORD In t
hELLO WORD In [6]: def list1_minus_list2(1ist1,list2): output-[] for item in list1: if item not in list2: output, append (item) return output In [18]: print (list1 minus_list2([1,2, "three",4],[1,2, "our",6])) ['three, 41 In
In [18]: def integer_n(n): output-8 while (n < 999); output+-n n-n 18+n return output In [19]: print(integer_n(5)) 665 In 1