-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathexercises.py
More file actions
63 lines (43 loc) · 1.82 KB
/
exercises.py
File metadata and controls
63 lines (43 loc) · 1.82 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#Declare two variables num1 and num2 and assign it a number value of your choosing.
#1. Addition
#Add the two variables and store it to a new variable named total.
#Print the total variable.
#2 Subtraction
#Subtract the two variables and store it to a new variable named difference.
#Print the difference variable.
#3 Multiplication
#Multiple the two variables and store it to a new variable named product.
#Print the product variable.
#4 Division
#Divide the two variables and store it to a new variable named quotient.
#Print the quotient variable.
#5 Modulus
#Find the modulus of the two variables and store it to a new variable named remainder.
#Print the remainder variable.
#6 Exponent
#Find the square of the num1 and store it to a new variable named double.
#Print the double variable.
#7 Floor Division
#Divide the two variables to find the rounded down integer and store it to a new variable named int_div.
#Print the int_div variable.
#8 Comparison and Logic
#Declare a variable named is_equal and compare two strings 'Tacocat' and 'tacocat' using the equality (==) operator.
#Print the is_equal variable.
#9 Declare a variable named not_equal and compare the string value of '8' with the number value 8 using the inequality (!=) operator.
#Print the not_equal variable.
#10 Assignment
#Declare a variable named num3 and assign it a number of your choosing.
#Increment and assign 5 to the num3 variable.
#Print your results.
#Decrement and assign 7 to the num3 variable.
#Print your results.
#Multiple and assign 3 to the num3 variable.
#Print your results.
#Divide and assign 2 to the num3 variable.
#Print your results.
#Modulus and assign 8 to the num3 variable.
#Print your results.
#Exponent and assign 3 to the num3 variable.
#Print your results.
#Floor divide and assign 4 to the num3 variable.
#Print your results.