Hello, there!
There are some issues with your code.
-
It’s not advisable to use key words (or similar) in your variable names… so
true
is not a good variable name (the Python boolean isTrue
). Try using names that give you a better idea of the variable will hold. For this specific case, I’d use something likeuser_reply
, for example. Same goes forcommand
. This is a keyword in Python, so avoid using them. -
According to Python PEP, variables should be in lowercase… so
Name
is not very pythonic. This is to keep style. Code will work no matter how you write it. Check this: How to Write Beautiful Python Code With PEP 8 – Real Python -
The
Game
variable is holding nothing… it’s just an empty string. -
Observe that your
true
variable is holding the user response… that’s the one you have to check in your WHILE loop… but you are not. So, make sure you check the user response to re-direct your code execution. -
And this is perhaps your biggest issue: the WHILE loop is only checking ONCE if the player wants to play or not! And you need to make this part of the loop. SO… Here is a small piece of code I just wrote. It’s not complete (use it as a guide). Analize it and modify it as you need…
Let me know how you solve the game, and post it here!