NumberGuess Project

I am stuck on the NumberGuess project, I can’t for the life of me see where the error is. I’ve tried using %s, %2d, and %d. None have worked. I have also used % (max_val) with brackets and without brackets % max_val. The get unstuck section does not use brackets. I’ve tried looking at the video tutorial and the get unstuck section, as well as googling it.

I think the following site would be of use to you as it covers a lot of the string formatting options available in Python2-

Generally it is advised to use the .format() method instead of the older %-formatting. You can view some slightly more technical details of the formatting options in the Python docs (but for starting out I think the previous link is easier)-

You didn’t put parenthesis around your print statement at the end of the code you posted

By the looks of the code (the use of raw_input), the OP appears to be using Python 2.

1 Like