while-loop

using and vs or in statments

using and vs or in statments Question: while gender.capitalize() != "M" and gender.capitalize() != "F" and gender.capitalize() != "Male" and gender.capitalize() != "Female": print("Not a valid entry: ") gender = (input("Gender: ")) if gender.capitalize() == "M" or gender.capitalize()== "Male": print("Hello " + name + " you are " + age + " years old and …

Total answers: 2

New to coding and pranking friend who knows nothing, but my script input breaks

New to coding and pranking friend who knows nothing, but my script input breaks Question: I know it sounds dumb, but I am making an annoying baby simulation that repeatedly asks questions unless given an exact input response to prank a friend. I have a set of random questions as well as random follow-up questions …

Total answers: 2

i Have a problem where my while loop doesn't consider the second condition

While loop doesn't consider the second condition Question: def login(): usern = "" pwd = "" logged = False while str(usern) not in keys and str(pwd) not in value: while str(usern) not in keys: usern = input("please enter Username: ") if usern not in keys: print("Incorrect username!") pwd = input("Please enter your password!: ") if …

Total answers: 2

while loop as long as value doesn't change

while loop as long as value doesn't change Question: I need to solve a newbie IQ 70 problem, but can’t find a way to do it. I need to quit the while loop if the block_number changes. Can’t be that difficult! while await asyncio.sleep(interval, True): block_number= get_current_block_number() while block_number stays the same: insert data into …

Total answers: 2

How to put this in a loop

How to put this in a loop Question: I need to put this code in a loop so that you can choose whichever number first and go back to the start after whichever one you choose, but everything I’ve tried hasn’t worked and need help. peoples = { "Mary": { "name": "Mary", "budget": 100, "items": …

Total answers: 1