I’m getting None in output

Asked

Viewed 70 times

0

    l = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
num = int(input(print("Choose a number: ")))

new_list = []

for i in l:
    if i < num:
        new_list.append(i)

print(new_list)

I’m doing this exercise that asks to enter a number and print a new list based on the indicated that has all the values below the indicated by the user, but no output continues to print None, for example:

    Choose a number: 
None 8
[1, 1, 2, 3, 5]

What I’m doing wrong?

1 answer

7


Browser other questions tagged

You are not signed in. Login or sign up in order to post.