Anonymous asked in Computers & InternetProgramming & Design · 5 months ago

Why might my else statement in an if,elif, and else statement in python not work?

4 Answers

  • 5 months ago
    Best answer

    Lots of possibilities here: wrong conditions, missing colon, wrong indentation, wrong statement order, unclosed parenthesis/bracket/brace/triple-quote on a previous line, and probably some other things.

  • Chris
    Lv 7
    5 months ago

    Are we supposed to guess randomly?

    Or could you maybe, just maybe, add your goddamn code to the question?

  • 5 months ago

    most common - improper "grammar", you've got something missing or an extra parenthesis or what-have-you

    often - improper logic or a typo (for example of the latter: letter O where there should be the number 0)

  • 5 months ago

    Most of the time it is the combination of "and" and "or" statements. Programming must be exact.

Still have questions? Get answers by asking now.