Ask coding questions

← Back to all posts
NEED HELP
AlexanderSmith8 (2)

I need help. My teacher is not here and i am trying to get the code for a phyton guassing game for fee

Commentshotnewtop
MarsExplorer (1)

replace line 23 with print("it took you",tries,"tries to guess the number"

MarsExplorer (1)

@Marsexplorer it will only work if tries is a string. otherwise, set try to a string

MarsExplorer (1)

i mean it will only work if random_number is a sring

MarsExplorer (1)

to set a non-string to a string, use str(non-string), replacing non string with what you want to turn into a string

Guidi500 (0)

replace line 23 with print("It took you " + str(tries)+" tries to guess the number!")

ash15khng (404)

"f-strings" are not a thing in Python 2. To use them move to a Python 3 repl.

Goldrank (31)

remove the f on line 23