How do I check if a string with a user given input is equal to a certain letter/ word in Python

159 Views Asked by At

This isn't working and I don't know why. Help needed!

I have defined a string:

userin = "h"

I ask the user for an input:

userin = raw_input()

I have a while loop that runs if the string is not equal to a certain letter and an if (within the while) that checks if the string is equal to a certain letter:

while (userin!="c" or low == high):
userin = raw_input()
if userin is "c"
    break
1

There are 1 best solutions below

1
On BEST ANSWER

Indent your code correctly

while (userin!="c" or low == high):
    userin = raw_input()