-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpractice3.py
More file actions
24 lines (21 loc) · 737 Bytes
/
practice3.py
File metadata and controls
24 lines (21 loc) · 737 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
# No Starch Press - First Practice.
"""
TRY IT YOURSELF
2-8) Number Eight: Write addition, subtraction, multiplication, and division
operations that each result in the number 8. Be sure to enclose your operations
in print statements to see the results. You should create four lines that look
like this: print(5+3).
2-9) Favorite Number: Store your favorite number in a variable. Then, using
that variable, create a message that reveals your favorite number. Print that
message.
"""
#2-8
#Printing operations.
print(5+3)
print(10-2)
print(4*2)
print(16/2)
#2-9
favorite_number = 10 #store my favorite number in a variable.
message = 'my favorite number is :' #store a string with a message.
print(message +' '+ str(favorite_number))