Ask coding questions

← Back to all posts
Guess a number game
JaneDuncan (4)

please figure out how to help me code this game for my tech class

Answered by margob (1) [earned 5 cycles]
View Answer
Comments
hotnewtop
margob (1)

someone help me as well, i dont understand this class

ash15khng (712)

Hi, sorry in advance if I sound rude, but can you minimally give us a start and not expect us to help you to your homework for you? If you had a syntax error or a bug in your code somewhere I would be willing to help, but if you just expect us to give you the answer to your homework you should be doing, I don't think this is the right place to find it.

AzureScripts (179)

If you want it in python, you could do

import random
number = random.randint(1,10) # You can change 1 - 10 to whatever, p.s this chooses a random number
print("Guess the number!")
choice = int(input("What is the number? : "))
if choice == number:
print("You got it right!")
else:
print("Wrong!")

AzureScripts (179)

Remember to indent where the indents are needed

if choice == number:
print("Got it right")
else:
print("Got it wrong!")

ash15khng (712)

Hello, do you have any kind of start to this?

Reader8765 (18)

Where is your effort? This can easily be accomplished with random, print, input, and if-else statements.

pyelias (2411)

What exactly is the game?

margob (1)

@pyelias guess a number game, youre guessing a niumber in between 1 and 10 in python

JaneDuncan (4)

@pyelias its a game called guess a number where you have to code a game for people to guess the number