-1
    import random
    lotteryNumbers = []
    choice1=int(input('1st number:'))
    choice2=int(input('2nd number:'))
    choice3=int(input('3th number:'))
    choice4=int(input('4th number:'))
    choice5=int(input('5th number:'))
    choice6=int(input('6th number:'))
    for i in range (0,6):
      number = random.randint(1,49)
      while number in lotteryNumbers:
        number = random.randint(1,49)
      lotteryNumbers.append(number)
    print("Lottery numbers are: ") 
    print(lotteryNumbers)
    if choice1 == lotteryNumbers[0] or lotteryNumbers[1] or lotteryNumbers[2] or lotteryNumbers[3]or 
    lotteryNumbers[4]or lotteryNumbers[5]:
      print("first number: match")
    else:
      print("not match")

1.this is my original code pls help me to fix this problem. Thanks you very much

  • Any time you find yourself naming variables like `choice1`, `choice2`, etc. you should almost always be using a list. – Barmar May 14 '20 at 14:52

1 Answers1

1

you simply need to do

if choice in lotteryNumbers
Sowjanya R Bhat
  • 1,128
  • 10
  • 19