Getting input
name = input("Enter your name: ") age = input("Enter your age: ") print("Hello " + name + "! You are " + age)
Calc
# Python is just going to convert it into a string by default. num1 = input("Enter a number: ") num2 = input("Enter another number: ") result = float(num1) + float(num2) # int = integer, float is for decimal number.
print(result)
Mad Libs (空欄補充のゲーム)
# print("Roses are {color}")
# print("{plural noun} are blue")
# print("I love {celebrity}")
color = input("Enter a color: ") plural_noun = input("Enter a Plural Noun: ") celebrity = input("Enter a celebrity: ")
print("Roses are " + color) print(plural_noun + " are blue") print("I love " + celebrity)