-
Notifications
You must be signed in to change notification settings - Fork 0
/
conditionals_exercise3.py
24 lines (21 loc) · 987 Bytes
/
conditionals_exercise3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#######################################################################################################
# Conditionals - Lab Exercise 4
#
# Use the variable x as you write this program. x will represent a string.
# Write a program using the elif keyword that determines if x is a primary color (red, blue, or yellow).
# If yes, print _ is primary color, where the blank is the value of x.
# If no, print _ is not a primary color, where the blank is the value of x.
#
# Expected Output:
# If x is red, then the output would be: red is a primary color.
# If x is teal, then the output would be: teal is not a primary color.
#
#######################################################################################################
x='blue'
if x == "red":
print("x is red is a primary color")
elif x == "blue":
print("blue is a primary color")
elif x == "yellow":
print("yellow is a primary color")
# Output => blue is a primary color