Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- y = random.randint(1, 50)
- x = y // 2
- while x > 1:
- if y % x == 0:
- print(y, 'has factor', x)
- break
- x -= 1
- else:
- print(y, 'is prime')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement