So I've been trying to make a basic text game in python, and I'm using this code to constantly generate random numbers for use in certain functions to decide if the player is damaged, the player is attacked, etc.:
rng = random.randint(0,100)
while True:
rng = random.randint(0,100)
My first line of code that is actually displayed to the user, which asks if the player would like to play, won't run when I put the loop to generate random numbers at the start of my program. PyCharm says that the code is unreachable. How can I solve that? Here is that line, for reference:
game = raw_input("Would you like to play? Y/N\n")
Nothing is displayed on the screen when I run the program, unless I take out the loop. Sorry if the answer is obvious, I've only been working on python for a short amount of time.