Skip to content

Commit ef743d9

Browse files
committed
"if" statements
1 parent 517ca9e commit ef743d9

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

"if" statements/main.py

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
##
2+
# "If" Statements Lecture
3+
##
4+
5+
# -*- coding: utf-8 -*-
6+
7+
8+
# if condition:
9+
# Action
10+
11+
click = False
12+
13+
Like = 0
14+
15+
click = True
16+
17+
if click == True:
18+
Like = Like + 1
19+
click = False
20+
21+
# print(Like)
22+
23+
Temperature = 20
24+
Thermo = 15
25+
# print(Thermo)
26+
if Temperature <= 15:
27+
Thermo = Thermo + 5
28+
29+
# print(Thermo)
30+
31+
if Temperature >= 20:
32+
Thermo = Thermo - 3
33+
34+
# print(Thermo)
35+
36+
Time = "Day"
37+
Sleepy = False
38+
Pajamas = "Unknown"
39+
InBed = True
40+
41+
print(Pajamas)
42+
43+
if Time == "Night" or Sleepy == True:
44+
Pajamas = "On"
45+
46+
elif Time == "Morning":
47+
Pajamas = "On"
48+
49+
else:
50+
Pajamas = "Off"
51+
52+
53+
print(Pajamas)

0 commit comments

Comments
 (0)