-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSloan_hw5_fall2022.py
65 lines (42 loc) · 1.54 KB
/
Sloan_hw5_fall2022.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
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
61
62
63
64
65
# Create Header Variable
header = ("* Welcome! This is homework 5 for Sebastian Sloan Due 10/13/2022*")
print(header)
print("")
print("")
# Instructions
print("Below you will be asked to input any 5 numbers of your choosing")
print("Please input each number one at a time, then the program will total and average of")
print("your numbers for you, Thank you!")
print("")
print("*PLEASE NOTE!: numbers entered will only be counted")
print("to the second decimal place.")
print("")
print("")
print("")
print("")
# Create Inputs
firstNum = input("Please input any number:")
print(round(float(firstNum),2))
print("")
secondNum = input("Please input any number:")
print(round(float(secondNum),2))
print("")
thirdNum = input("Please input any number:")
print(round(float(thirdNum),2))
print("")
fourthNum = input("Please input any number:")
print(round(float(fourthNum),2))
print("")
fithNum = input("Please input any number:")
print(round(float(fithNum),2))
print("")
# Total numbers together
numberInputs = [round(float(firstNum),2), round(float(secondNum),2), round(float(thirdNum),2), round(float(fourthNum),2), round(float(fithNum),2)]
totalOfNumbers = round(sum(numberInputs),2)
print("")
print("")
print("")
print("Thank you,")
print(f"the values you entered are: {round(float(firstNum),2)}, {round(float(secondNum),2)}, {round(float(thirdNum),2)}, {round(float(fourthNum),2)} and {round(float(fithNum),2)}")
print(f"the total of the numbers you input is: {totalOfNumbers}")
print(f"the average of your input numbers is: {round(float(totalOfNumbers/5),2)}")