-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
33 lines (23 loc) · 1.42 KB
/
main.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
25
26
27
28
29
30
31
32
33
#Jaunel Deans
#September 29, 2023
#In this code, we predicted when would happen if specific lines of codes were changed. Also, we analzyed the different aspects and parts of the code.
# Starter code
num1 = 25
num2 = 4
print("Enter a number")
num3 = int(input())
total1 = num1 // num2
total2 = num3 + num2
total3 = total1 - total2
# How many variables are used in the code?
# Answer: 6 variable are used in the code.
# Give the line number where an output statement is used.
# Answer: Line 9. print("Enter a number") will output the words, "Enter a number"
# What symbol is used for variable assignment?
# Answer: (=) assignment operator
# What value is stored in total1 at the end of the program?
# Answer: The value in total1 by the end of the program is the product of the values in num1 and in num2. num1 has a value of 25 and num2 has a value of 4. Therefore, the total1 is assigned the product of 25 and 4 which is 100.
# What value is stored in num3 at the end of the program?
# Answer: num3 will have the value of the whole number/integer that the user inputted.
# Line 8 is changed to total1 = num1 // num2. How would it affect the program?
# Answer: total1 would be assigned the quotient of the values in num1 and in num2. num1 has a value of 25 and num2 has a value of 4. Therefore, the total1 is assigned the quoient of 25 and 4 which is 6. Therefore, the value in total1 will change to the value of total2 from 6.