SHARE
TWEET

1q(lista de ferias)

DomMisterSoja Jul 16th, 2018 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import random
  2. mem = 0
  3. n1 = random.randint(1,100)
  4. n2 = random.randint(1,100)
  5. while(n2==n1):
  6.     n2 = random.randint(1,100)
  7. n3 = random.randint(1,100)
  8. while(n3==n1 or n3==n2):
  9.     n3 = random.randint(1,100)
  10. n4 = random.randint(1,100)
  11. while(n4==n1 or n4==n2 or n4==n3):
  12.     n4 = random.randint(1,100)
  13. n5 = random.randint(1,100)
  14. while(n5==n1 or n5==n2 or n5==n3 or n5==n4):
  15.     n5 = random.randint(1,100)
  16. n6 = random.randint(1,100)
  17. while(n6==n1 or n6==n2 or n6==n3 or n6==n4 or n6==n5):
  18.     n6 = random.randint(1,100)
  19. n7 = random.randint(1,100)
  20. while(n7==n1 or n7==n2 or n7==n3 or n7==n4 or n7==n5 or n7==n6):
  21.     n7 = random.randint(1,100)
  22. n8 = random.randint(1,100)
  23. while(n8==n1 or n8==n2 or n8==n3 or n8==n4 or n8==n5 or n8==n6 or n8==n7):
  24.     n8 = random.randint(1,100)
  25. n9 = random.randint(1,100)
  26. while(n9==n1 or n9==n2 or n9==n3 or n9==n4 or n9==n5 or n9==n6 or n9==n7 or n9==n8):
  27.     n9 = random.randint(1,100)
  28. n10 = random.randint(1,100)
  29. while(n10==n1 or n10==n2 or n10==n3 or n10==n4 or n10==n5 or n10==n6 or n10==n7 or n10==n8 or n10==n9):
  30.     n10 = random.randint(1,100)
  31. n11 = random.randint(1,100)
  32. while(n11==n1 or n11==n2 or n11==n3 or n11==n4 or n11==n5 or n11==n6 or n11==n7 or n11==n8 or n11==n9 or n11==n10):
  33.     n11 = random.randint(1,100)
  34. n12 = random.randint(1,100)
  35. while(n12==n1 or n12==n2 or n12==n3 or n12==n4 or n12==n5 or n12==n6 or n12==n7 or n12==n8 or n12==n9 or n12==n10 or n12==n11):
  36.     n12 = random.randint(1,100)
  37. n13 = random.randint(1,100)
  38. while(n13==n1 or n13==n2 or n13==n3 or n13==n4 or n13==n5 or n13==n6 or n13==n7 or n13==n8 or n13==n9 or n13==n10 or n13==n11 or n13==n12):
  39.     n13 = random.randint(1,100)
  40. n1 = str(n1)
  41. n2 = str(n2)
  42. n3 = str(n3)
  43. n4 = str(n4)
  44. n5 = str(n5)
  45. n6 = str(n6)
  46. n7 = str(n7)
  47. n8 = str(n8)
  48. n9 = str(n9)
  49. n10 = str(n10)
  50. n11 = str(n11)
  51. n12 = str(n12)
  52. n13 = str(n13)
  53. usuario = [n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13]
  54. print(usuario)
  55. gabarito= input("Insira os 13 numeros do gabarito")
  56. gabarito = gabarito.split(" ")
  57. print('Os números da cartela: ',gabarito)
  58. for i in usuario:
  59.     for a in gabarito:
  60.         if i == a:
  61.             mem = mem + 1
  62.         else:
  63.             mem = mem
  64. print ('Os números de acertos foram:', mem)
  65. if(mem == 13):
  66.     print("Ganhador")
  67.     print('Esse foram os números sorteados: ',usuario)
  68. else:    
  69.     while (mem != 13):
  70.         mem = 0
  71.         gabarito= input("Insira os 13 numeros do gabarito")
  72.         gabarito = gabarito.split(" ")
  73.         print('Esse foram os números sorteados: ',usuario)
  74.         print('Os números da cartela: ',gabarito)
  75.         for i in usuario:
  76.             for a in gabarito:
  77.                 if i == a:
  78.                     mem = mem + 1
  79.                 else:
  80.                     mem = mem
  81.         print ('Os números de acertos foram:', mem)
  82.         if (mem == 13):
  83.             print("Ganhador")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top