0

that is the file and its output is Numbers: 1 ('Found by ', 'Jack') 5 NF 0 NF 0 NF 4 NF 2 NF im confused why its outputting like that because it is supposed to output by just saying 1 Found by Jack but like it doesnt like me and im running version2.7.16 python using visual studio code. Im been working on trying to find out why this issue is occuring when it isnt so like please help cuz im going mad and feel like throwing my pc out of the window and giving up

      import random
      print("\033c")
      print('Lottery Numbers Randomizing')
      x1 = random.randint(0, 6)
      x2 = random.randint(0, 6)
      x3 = random.randint(0, 6)
      x4 = random.randint(0, 6)
      x5 = random.randint(0, 6)
      x6 = random.randint(0, 6)
      time.sleep(1)
      guesser1 = raw_input('Enter Your Name: ')
      print'Hello', guesser1, 'Please Guess 6 Different Numbers to possibly win a prize'
      time.sleep(3)
      print("\033c")
      guess1 = input('Enter Guess for number 1: ')
      print("\033c")
      guess2 = input('Enter Guess for number 2: ')
      print("\033c")
      guess3 = input('Enter Guess for number 3: ')
      print("\033c")
      guess4 = input('Enter Guess for number 4: ')
      print("\033c")
      guess5 = input('Enter Guess for number 5: ')
      print("\033c")
      guess6 = input('Enter Guess for number 6: ')
      print("\033c")
      time.sleep(1)
      guesser2 = raw_input('Enter Your Name: ')
      print'Hello', guesser2, 'Please Guess 6 Different Numbers to possibly win a prize'
      time.sleep(3)
      print("\033c")
      g2uess1 = input('Enter Guess for number 1: ')
      print("\033c")
      g2uess2 = input('Enter Guess for number 2: ')
      print("\033c")
      g2uess3 = input('Enter Guess for number 3: ')
      print("\033c")
      g2uess4 = input('Enter Guess for number 4: ')
      print("\033c")
      g2uess5 = input('Enter Guess for number 5: ')
      print("\033c")
      g2uess6 = input('Enter Guess for number 6: ')
      print("\033c")
      if guess1 == x1:
          found1 = 'Found by ', guesser1
      elif guess1 != x1:
          found1 = ('NF')
          if g2uess1 == x1:
              found1 = 'Found by ', guesser2
      if guess2 == x2: 
          found2 = 'Found by ', guesser1
      elif guess2 != x2:
          found2 = ('NF')
          if g2uess2 == x2:
              found2 = 'Found by ', guesser2
      if guess3 == x3:
          found3 = 'Found by ', guesser1
      elif guess3 != x3:
          found3 = ('NF')
          if g2uess3 == x3:
              found3 = 'Found by ', guesser2
      if guess4 == x4:
          found4 = 'Found by ', guesser1
      elif guess4 != x4:
          found4 = ('NF')
          if g2uess4 == x4:
              found4 = 'Found by ', guesser2
      if guess5 == x5:
          found5 = 'Found by ', guesser1
      elif guess5 != x5:
          found5 = ('NF')
          if g2uess5 == x5:
              found5 = 'Found by ', guesser2
      if guess6 == x6:
          found6 = 'Found by ', guesser1
          np = 6
      if guess6 != (x6):
          found6 = ('NF')
          np = 6
          if g2uess6 == x6:
              found6 = ('Found by ', guesser2)
      if np >= 6:
          print('Numbers:', x1 , found1 , x2 , found2 , x3 , found3 , x4 , found4 , x5 , found5 , x6 , found6
  • your `guess` variables are strings and you're comparing them to the `x_` variables which are ints. Change to `int(input(...))`. Anyway, you should really try to work out a [mre] – Tomerikoo May 30 '20 at 21:43
  • Does this answer your question? [TypeError: '<=' not supported between instances of 'str' and 'int'](https://stackoverflow.com/questions/41950021/typeerror-not-supported-between-instances-of-str-and-int) or better yet, the dup inside that question: https://stackoverflow.com/questions/20449427/how-can-i-read-inputs-as-numbers – Tomerikoo May 30 '20 at 21:45
  • That's a lot of code. Can you narrow it down bit? – peer May 30 '20 at 21:48

0 Answers0