Facebook
From Tacky Earthworm, 4 Years ago, written in Python.
This paste is a reply to Assignment 3 from Favourjama - go back
Embed
Viewing differences between Assignment 3 and Re: Assignment 3
# question 1 and 2
def vowel_counter ():
  user_input= input ("Enter Word")
  number_of_vowels = 0
  for i in user_input:
    if i=="a" or i=="e" or i=="i" or i=="o" or i=="u":
      number_of_vowels+=1
  if number_of_vowels==1:
    print (f " {user_input} contains {number_of_vowels} vowel")
    
  else:
    print (f " {user_input} contains {number_of_vowels} vowels")
    
#question 3
def maximum (arr):
          highest =0
    for i in arr:
      if i>i>=highest:
        highest=i
      print (highest)
maximum([1,2,44,98])
      
#question 4
def summation (arr):
  sum=0
  for i in arr:
    sum +=i
  print (sum)
summation ([1, 2, 3, 5])