total = 0
index = 1
while index <= 5:
print('adding ' + str(index))
total = total + index
index = index + 1
print(total)adding 1
adding 2
adding 3
adding 4
adding 5
15
while loopswhile loops with aggregationsum_alllow and highlow and high summing all values (HINT: you need to create a variable that will aggregate or accumulate the sum)low and highwhile (define an index before the loop, use index in the while condition, change the index inside the loop)Write more test cases for this function.
Write a function called count_vowels that takes a string as argument, and returns an integer with the number of vowels in the string.
HINT: use in to determine if a character is a vowel
vowels_onlystring argumentstring argumentindex before the loop, use index in the while condition, change index inside the loop)Write more test cases for this function.
factorialnumbernumber1 * 2 * 3 * 4 = 24whileWrite more test cases for this function.
Submit your factorial function to Gradescope for attendance.
Name your file factorial.py
powerbase and expbase to the power of exp** operator, use a while loop (define an index before the loop, use index in the while condition, change index inside the loop)Write more test cases for this function.