Friday 5 July 2019

I'm having trouble with 'while' in python

Here is my code:



while c2 != 1 or 2:

c2 = input('<1.Enter the kitchen> <2.Exit the house> ')


I was trying to make a text-based rpg, but this part kept stuffing up! I wanted the console to keep asking for the input until the 'c2' variable was 1 or 2, but it kept looping! What am I doing wrong?

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...