Advertisement
AntoniiaG

Untitled

Nov 27th, 2023 (edited)
533
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. import random
  2.  
  3. l1 = [] #изтеглени числа
  4. l2 = [] #избрани от потребителя числа
  5. sum = 0
  6. d = range(1,50)
  7. l1 = random.sample(d, 6)
  8.  
  9. print(l1)
  10. c = 0
  11. while c < 6:
  12.     b = int(input())
  13.     if b >= 1 and b < 50 and b not in l2:
  14.         l2.append(b)
  15.         c+=1
  16. print(l2)
  17.  
  18. for i in range(len(l2)): #теглене на числата
  19.     if l2[i] in l1:
  20.         sum += 1
  21. print(sum)
  22. if sum == 3:
  23.     print("Win 300")
  24. elif sum == 5:
  25.     print("Win 500")
  26. elif sum == 6:
  27.     print("Ground price")
  28. else:
  29.     print("No win")  
  30.  
  31.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement