Ask coding questions

← Back to all posts
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

MarsExplorer (11)

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

MarsExplorer (11)

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

MarsExplorer (11)

i mean it will only work if random_number is a sring

MarsExplorer (11)

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 (681)

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

Goldrank (34)

remove the f on line 23