-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3-input-output.py
More file actions
28 lines (19 loc) · 798 Bytes
/
Copy path3-input-output.py
File metadata and controls
28 lines (19 loc) · 798 Bytes
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
# name = input("What is your name? ")
# print("Hello", name)
# age = int(input("How old are you? "))
# years_to_100 = 100 - age
# print(f"You will be 100 in {years_to_100} years")
# num1 = float(input("Enter first number: "))
# num2 = float(input("Enter second number: "))
# sum_result = num1 + num2
# print(f"The sum of {num1} and {num2} is {sum_result}")
# Working with multiple inputs on one line
# x, y = input("Enter two values seperated by space: ").split()
# print(f"first value: {x}, second value: {y}")
user_choice = input("Choose a color (or press Enter for default): ")
if user_choice == "":
user_choice = "blue"
print(f"Selected color: {user_choice}")
# possiblities are endless
length = float(input("Enter length in meters: "))
print(f"That's {length * 100} centimeters")