-
Notifications
You must be signed in to change notification settings - Fork 0
/
04_userInput.py
39 lines (27 loc) · 895 Bytes
/
04_userInput.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
# name = input("Enter yoir name: ")
# age = int(input("Enter your age: "))
# age = age+2
# print(f"hello {name}")
# print(f"Your age after 2 years {age}")
# 1. mad libs
# adjective1 = input("enter an adjective: ")
# noun = input("Enter a noun: ")
# adjective2 = input("enter an adjective: ")
# verb = input("enter a verb: ")
# adjective3 = input("enter an adjective: ")
# print(f"Today I went to a {adjective1} zoo")
# print(f"in a exhibit, I saw {noun}")
# print(f"{noun} was {adjective2} and {verb}ing")
# print(f"i was {adjective3}")
# 2. area calc
# length = int(input("lenght: "))
# width = int(input("width: "))
# height = float(input("height: "))
# area = length*width*height
# print(f"Area: {area}")
# 3. Shopping cart
item = input("item name: ")
price = float(input("price: "))
quantity = int(input("qua: "))
total = price*quantity
print(f"total cost is {round(total, 2)}")