Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  2. print("Your marks :" + str(a))
  3.  
  4. less = list(filter(lambda x: x < 5, a))
  5. print("Your marks which are less then 5: " + str(less))
  6.  
  7. mark = int(input("New mark: "))
  8. a.append(mark)
  9.  
  10. if mark < 5:
  11. less = list(filter(lambda x: x < 5, a))
  12. print("Next time better mark is below 5!: " + str(less))
  13. else:
  14. print("Cool! no mark below 5!")
  15. scndmark = int(input("Second Mark: "))
  16. higher = list(filter(lambda x: x >= scndmark, a))
  17. print("Marks higher then your second mark: " + str(higher))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement