Python Forum
Guess Random Number Why i m not able to enter input
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Guess Random Number Why i m not able to enter input
#5
you didn't indent correctly
This is how I did it but I had a bit of problems with it
guessnumber=0

import random
Mystery = random.randint(0,9)

while guessnumber==int(input("Guess a number between 0-9: ")):
    if guessnumber > Mystery:
        print('The number you input is not the mystery number, try again.')
    guessnumber = int(input("Enter a guess: ")
 if guessnumber == Mystery:
Reply


Messages In This Thread
RE: Guess Random Number Why i m not able to enter input - by RandomCoder - Jan-07-2018, 01:56 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Guess the word game help jackthechampion 3 3,025 Sep-06-2023, 06:51 AM
Last Post: Pedroski55
  find random numbers that are = to the first 2 number of a list. Frankduc 23 3,211 Apr-05-2023, 07:36 PM
Last Post: Frankduc
  matrix number assignement to the random indices juniorcoder 4 1,921 Feb-19-2022, 02:18 PM
Last Post: juniorcoder
  Ask again if wrong guess with While. EduPy 4 2,251 Oct-21-2021, 07:46 PM
Last Post: menator01
  Generate random hex number ZYSIA 1 11,578 Jul-16-2021, 09:21 AM
Last Post: DeaD_EyE
  I guess it's about print tsavoSG 2 2,114 Feb-08-2021, 08:34 PM
Last Post: steve_shambles
  Generate Random operator, take user input and validate the user mapypy 4 5,555 Feb-03-2021, 08:41 PM
Last Post: nilamo
  Calling Input for Random Generation ScaledCodingWarrior 1 1,860 Feb-02-2021, 07:27 PM
Last Post: bowlofred
  Random Number Repeating Tzenesh 5 4,029 Jan-13-2021, 10:00 PM
Last Post: deanhystad
  Random number generator charlottelol 5 3,224 Nov-10-2020, 10:51 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020