-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweek4_notes.py
More file actions
38 lines (23 loc) · 975 Bytes
/
Copy pathweek4_notes.py
File metadata and controls
38 lines (23 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#week 4 class notes
# import.math #import comes before a function
days_in_a_week = 7 #constant (doesn't change) comes before a function
g = 4 #global variables are outside a function, minimize using them.
#don't use them in this course.
def main():
a = 10 #local variables are in a function
b = 20
do_things(a,b)
True
False #boolean value
lights_are_on = True
object_is_recyclable = False #boolean value can be stored in a variable
10 > 20 #returns boolean value False
10 < 20 #returns boolean value True
2 == 1 #checks for equality this returns False
2 >= 1 #greather than or equal to returns True
2 <= 1 #less than or equal to returns False
2 != 1 #checks for inequality returns True
print(a != b) #returns boolean value
def do_things(a,b):
print(a + b)
main()