开发者

why is my program using the else statement before letting me input [closed]

开发者 https://www.devze.com 2022-12-07 18:42 出处:网络
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.

This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.

Closed 3 hours ago.

Improve this question

the program I am writing is not letting me use my input function. it continues to use my else option even though I have not entered a selection. I am trying to use pressing enter as a selection and q as a method to stop the program.

i have tried using break to stop my code from looping. I have tried changing my s开发者_如何学Celection to a different variable that is not used in the code elsewhere however when I try it says I don't have an input and uses my else statement

def SimTurn(selection):
    while (selection == sixthComplexCases() or fifthCreateListEdgeCases() or fourthSimpleBirth() or threeSingleBirth() or twoSingleCritter() or oneEmpty()):
        selection = ""
        SimGame = True 
        selection = print("Hit enter to continue ('q' to quit): ")
        if selection == "":
            SimGame()
        elif selection == ("q" or "Q"):
            quit()
        else:
            print("Please make a proper selection")
        break
        

0

精彩评论

暂无评论...
验证码 换一张
取 消