Welcome Guest.

2Answers

Python grammar error

Asked by: Willie Richards 35 views IT September 29, 2022

Python invalid grammar

2 Answers

  1. +6Votes  

    Else must follow the IF.The IF statement format is as follows:

    IF syntax:#i execute when the syntax result is TRUE

    condition code

    Elif:

    condition code

    .

    . #Here you can have multiple elf

    .

    Else:

    condition code

    if is equivalent to ‘if’, else is equivalent to ‘or’, else is equivalent to ‘otherwise’.

    What if it is:

    What to do

    or how to do:

    What to do

    .

    .#Severa the four grids

    .

    Otherwise:

    What to do

    YouYou can go to this website: https://www.***.com/python3/python3- conditional-tatements.html

    Cooper- September 29, 2022 |

  2. +4Votes  

    Although the picture is not clear, it can be seen vaguely that you are yours.ELSE alignment is wrong. It cannot be at the same level of Def, and can only be the same level as IF or for (small space in front of ELSE)

    Sharon Rogers- September 29, 2022 |