File tree Expand file tree Collapse file tree 6 files changed +64
-0
lines changed
Expand file tree Collapse file tree 6 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ # Simple code lines in your programs are instructions
2+ # You instruct Python to do something specific
3+
4+ a = 4
5+
6+ 2 < 3
Original file line number Diff line number Diff line change 1+ # Flow Control
2+
3+ # temperature = 30
4+ # print("The weather is 😎")
5+
6+ # TASK: Decide ⛅ is 🥶 or 😎
7+
8+ # if condition:
9+ # statement(s)
10+
11+ temperature = 10
12+
13+ if temperature >= 18 :
14+ print ("The weather is 😎" )
15+ if temperature < 18 :
16+ print ("The weather is 🥶" )
Original file line number Diff line number Diff line change 1+ temperature = 20
2+
3+ if temperature >= 18 :
4+ print ("The weather is warm" )
5+ print ("😎" )
6+
7+ print ("..." )
Original file line number Diff line number Diff line change 1+ temperature = 31
2+
3+ if temperature >= 18 :
4+ print ("The weather is 👍" )
5+ if temperature > 30 :
6+ print ("The weather is 😎" )
7+
8+ print ("⛅" )
Original file line number Diff line number Diff line change 1+ temperature = 17
2+
3+ if temperature >= 18 :
4+ print ("The weather is 😎" )
5+ else :
6+ print ("The weather is 🥶" )
7+
8+ # Form
9+
10+ # if condition:
11+ # statement(s)
12+ # else:
13+ # statement(s)
14+
15+ # ? 🥶
Original file line number Diff line number Diff line change 1+ # elif -> else if
2+
3+ temperature = 3
4+
5+ if temperature >= 30 :
6+ print ("The weather is 😎" )
7+ elif temperature > 20 :
8+ print ("The weather is 👍" )
9+ elif temperature > 10 :
10+ print ("The weather is 👎" )
11+ else :
12+ print ("The weather is 🥶" )
You can’t perform that action at this time.
0 commit comments