while statment is stuck on an infinite loop in python -


task = "" while task != "e" or task != "d":      task = raw_input("would encrypt or decrypt\r\n:- ").lower() keyword = raw_input("enter keyword:-").lower() keyphrase = raw_input("enter key phrase:-").lower() 

does know why when code runs, while statment looped on , on when correct input has been entered. think parameters in while statment im not sure.

i have tried while statment 1 condition , works, don't see why not working multiple

your or statement evaluates true.

if task == 'e', task != 'd', , while loop evaluates true, making loop continue indefinitely.

change like:

task = " " while task not in "ed":     # stuff 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -