if else statement python practice problems with solution pdf

 if else statement python practice problems with solution pdf


if else


















problem 1

Next, after the ‘for’ loop has concluded, we return the ‘count’ variable that kept track of all elements greater than 30.

solution


def greater_than_30(numbers):
count = 0 for n in numbers: if n>30: count+=1 return count





Comments