elif statements
(equivalent to the else if in C language)
In Python, when we need to have more judgment, we tend to use a different syntax, that is, using elif:
if Judging condition 1: executing statement 1 elif Judging condition 2: executing statement 2 elif Judging condition 3: executing statement 3 ...... Else : EXECUTE statement n
Now that we have a task to complete, suppose there is now a score for you to rank as follows:
90 points and above belong to A;
80 to 89 points belongs to B;
70 to 79 cents belongs to C;
60 points to 69 cents belongs to D;
0 to 59 cents belongs to E;
You need to use the If/elif/else statement to output levels based on fractions.
Think about it a little bit!
More learning content, just in the code bud Net Http://www.mayacoder.com/lesson/unit?id=24
Python Beginner Learning Basics Conditional Statement--ELIF statement