If & elif


#1



https://www.codecademy.com/courses/python-beginner-BxUFN/3/4?curriculum_id=4f89dab3d788890003000096#

What are they asking us to do in this exercise? I am reading it over and over, but i cannot seem to comprehend what the task is


Clearer instructions preferrably


Replace this line with your code.


#2

You have came across 2 things before this exercise..

if statement.
if/else statement

In this exercise they are teaching ,How to make your program handle more conditionals by using elif

You can insert as many condition tests as you want by using elif.

if condition1:
    #your code
elif condition2:
    #yourcode
elif condition3:
    #yourcode
else:
    #yourcode

....you can add any number of elif's

at last you can add else

One more thing...

if or elif always need to have a conditional expression.
else goes without any condition

Now read the theory and instructions again!


#3

Not only are the instructions poorly written. No one has cared enough to improve the instructions.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.