repl.it
@axel9967/

hwk 2

Python

No description

fork
loading
Files
  • main.py
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
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
print("Let's add")
num1 = input ("Type in a first number. ")
num2 = input ("type in a second number. ")

num1 = int(num1)
num2 = int(num2)
print (num1 + num2)

print ("now let's subtract")

num3 = input ("Type in a first number. ")
num4 = input ("type in a second number. ")

num3 = int(num3)
num4 = int(num4)
print (num3 - num4)

print("now let's multiply")
num5 = input ("Type in a first number. ")
num6 = input ("type in a second number. ")
num7 = input ("Type in a third number. ")

num5 = int(num5)
num6 = int(num6)
num7 = int(num7)
print (num5 * num6 * num7)

print("Now let's divide")
num8 = input ("Type in a first number. ")
num9 = input ("type in a second number. ")

num8 = int(num8)
num9 = int(num9)
print (num8 / num9)

lbs = input("How many lbs. ")

lbs = int(lbs)
print (lbs * 0.45), print(' kg')

print("Please enter the length, width and depth of your swimming pool in meters.")
length = input ("Length. ")
width = input ("Width. ")
depth = input ("Depth. ")

length = int(length)
width = int(width)
depth = int(depth)

print("The volume of your swimming pool is "),  print(length * width * depth * 1000), print ('liters')

while True:
    print("To calculate the area and perimeter of a rectangle. ")
    b = float(input("Enter the base of the rectangle. "))
    h = float(input("Enter the height of the rectangle. "))
    a = (b * h)
    p = (2 * h + 2 * b)
    print("The area of the rectangle is ", a,
          " and the perimeter of the rectangle is ", p)

input()

Fetching token
?