Last answered:

11 May 2023

Posted on:

11 May 2023

0

no output when i call the function

def count(numbers):
    total = 0
    for x in numbers:
        while x < 20:
             total += 1 
    return total



count(nums)
why there is no output

1 answers ( 0 marked as helpful)
Instructor
Posted on:

11 May 2023

0

Hi Abdelrahman!
Thanks for reaching out.


Please, use the following code:

def count(numbers):
    total = 0
    for x in numbers:
        if x < 20:
             total += 1 
    return total


Hope this helps.
Best,
Tsvetelin

Submit an answer