Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #random generates 10 numbers and classifies them according to logic rules...
- import random
- counter = 0
- while True:
- random_number = random.randint(1, 100)
- print(random_number)
- if random_number > 80:
- print("Above 80")
- elif random_number <20:
- print("Below 20")
- elif random_number >=20 and random_number <=80:
- print("Between 20 and 80")
- counter = counter + 1
- if counter == 10:
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement