Skip to content

Commit 6da7ca5

Browse files
Challenge giving in class to test if statement knowledge
1 parent 0f5c095 commit 6da7ca5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

ifStatementExample2

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#Prompt:
2+
carSpeed = 40
3+
speedLimit = 60
4+
#End Prompt
5+
6+
#Create a program that tests if the car is going
7+
#above or below the given speed limit
8+
9+
if carSpeed < speedLimit:
10+
print('The car is going below the speed limit')
11+
if carSpeed > speedLimit:
12+
print('The car is going over the speed limit')
13+
if carSpeed == speedLimit:
14+
print('The car is going at exactly the speed limit!')

0 commit comments

Comments
 (0)