lotto.py 356 B

123456789101112131415161718192021
  1. import random as r
  2. list =[]
  3. while True:
  4. if len(list) <6:
  5. a=r.randint(1,49)
  6. if a not in list:
  7. list.append(a)
  8. else:
  9. break
  10. while True:
  11. if len(list)<7:
  12. b=r.randint(1,10)
  13. if b not in list:
  14. list.append(b)
  15. else:
  16. break
  17. list1=[str(x) for x in list]
  18. print " ".join(list1)