Guest User

Untitled

a guest
Mar 24th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. List = input('''Please give me a list of random number here, like '2,35,5,32':
  2. ''')
  3. num = input('''Please enter a number if you want to check what elements in your list is less than this number:
  4. ''')
  5. List = List.split(',')
  6. new_list = []
  7. for i in List:
  8. if num == '':
  9. if int(i) < 5:
  10. new_list.append(i)
  11. else:
  12. if int(i) < int(num):
  13. new_list.append(i)
  14. print (new_list)
Add Comment
Please, Sign In to add comment