+ 1

what is wrong in this code? i just can't fix it.

list=[1,2,3,4,5,6,9] new_list=[] n=int(input('enter a number: ') for i in list: if i<n: new_list.append(i) else: pass print(new_list)

31st Mar 2018, 5:00 PM
Tanvir Hasan
Tanvir Hasan - avatar
3 Answers
+ 6
Missing a bracket at line 4. Fix: n = int(input('Enter a number: '))
31st Mar 2018, 5:17 PM
TurtleShell
TurtleShell - avatar
+ 3
Haha, you’re welcome
31st Mar 2018, 5:21 PM
TurtleShell
TurtleShell - avatar
+ 1
TurtleShell you just saved my sanity.
31st Mar 2018, 5:19 PM
Tanvir Hasan
Tanvir Hasan - avatar