Advertisement
biswasrohit20

while

May 19th, 2021
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. num = 11
  2. increment = 1
  3. while 11 <= num <= 100:
  4. if num == 20:
  5. increment = 2
  6. elif num == 40:
  7. increment = -1
  8. elif num == 21:
  9. num = 41
  10. increment = 5
  11. print(num)
  12. num += increment
  13. if num > 100:
  14. print("Number is more than 100")
  15. break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement