Python Python Basics Types and Branching Use an if

Indra Bergmans
Indra Bergmans
2,199 Points

Not grasping If, Else and Elif.

I watched the video for this subject several times but I'm not grasping it and can't put it together. Anyone out there who has some advice?

Greetings Indra

branching.py
favorite_color = input("What is your favorite color?  ")

3 Answers

Steven Parker
Steven Parker
182,603 Points

You might try looking at some of the other questions that have been asked about this same exercise.

Just be aware that code people post will often be incorrect, but sometimes you can learn from their mistakes and/or from the answers.

Jordan DeLeon
Jordan DeLeon
1,074 Points

If and elif require specific actions to continue through their series of events, whereas else says if ANYTHING else happens outside these boundaries (if and elif) then run this other sequence.

Steven Parker
Steven Parker
182,603 Points

FYI: you won't need to worry about "elif" or "else" just yet — this particular challenge doesn't use either.

Indra Bergmans
Indra Bergmans
2,199 Points

Thank you all for answering. Yeah, I shouldn't have attached the code challenge. I just can't seem to grasp the info in the video. I'm going to give it another try with your explanations.

Thank you all!