Skip to content

Commit c5950b6

Browse files
committed
added extra credit
1 parent 0276bec commit c5950b6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

ex29.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
people = 20
2-
cats = 30
3-
dogs = 15
2+
cats = 15
3+
dogs = 30
44

55

66
if people < cats:
@@ -26,4 +26,10 @@
2626

2727

2828
if people == dogs:
29-
print "People are dogs."
29+
print "People are dogs."
30+
31+
# Extra credit
32+
# 1. The if statement executes the code under it if the expression is True
33+
# 2. The code under the if needs to be indented 4 spaces so that Python knows what code is part of the if block
34+
# 3. If the code wasn't indented, it would be executed, regardless of the Truthiness of the if statement
35+
# 5. IF we change the initial variables, we get different print statements.

0 commit comments

Comments
 (0)