-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharithmetric.py
More file actions
53 lines (25 loc) · 1.28 KB
/
Copy patharithmetric.py
File metadata and controls
53 lines (25 loc) · 1.28 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
#prompt user to enter three number each
first_number = int(input("Enter any number: "))
second_number = int(input("Enter any number: "))
third_number = int(input("Enter any number: "))
#sum the three numbers,get the average number of the three and multiply the three numbers
sum = first_number + second_number + third_number
average = ((first_number + second_number + third_number) / 3)
product = first_number * second_number * third_number
#reassign the first number to a new variable and check if the new variable is greater than the second number and then reassign the second number to the new #variable,do the same for the third number
smallest = first_number
if(smallest > second_number):
smallest = second_number
if(smallest > third_number):
smallest = third_number
print("The smallest number is", smallest)
#reassign the first number to a new variable and check if the new variable is less than the second number and then reassign the second number to the new #variable,do the same for the third number
highest = first_number
if(highest < second_number):
highest = second_number
if(highest < third_number):
highest = third_number
print("The highest number is", highest)
print("The sum of ", sum)
print("The average is ", average)
print("The product is ", product)