Guest User

Untitled

a guest
Mar 22nd, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. # This program prints the elements of a list that are less than a specified number
  2.  
  3. def ex3():
  4. a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
  5. b = []
  6.  
  7. num = int(input("Please enter a number: "))
  8.  
  9. for each in a:
  10. if each < num:
  11. b.append(each)
  12. print(b)
Add Comment
Please, Sign In to add comment