Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. import numpy
  2. from random import sample
  3. f = open("Python_Project.txt","w+")
  4. count = 0
  5. print("Enter 20 unique numbers within the range 1-100")
  6. while (count<20):
  7. x = int(input())
  8. if x > 0 and x < 101:
  9. f.write(str(x))
  10. f.write(" ")
  11. count += 1
  12. else:
  13. print("Please Enter a number between the range")
  14. f.close()
  15. myfile = open("Python_Project.txt", "r")
  16. contents = myfile.read().split(',')
  17. myfile.close()
  18. print(contents)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement