input()
input() = A function that prompts the user to enter data Returns the entered data as a string
即输入函数 注意input返回的是一个字符串,如果需要数字我们需要类型转换
name = input("What is your name?:")
print(f"Hello{name}")
# Exercise 1 Rectangle Area Calc
length = input("Enter the length: ")
width = input("Enter the width: ")
print("The area of the rectangle is:", int(length) * int(width))
# Madlibs game
# word game where you create a story
# by filling in blanks with random words
adjective1 = input("Enter an adjective(decription): ")
noun1 = input("Enter a noun(person place thing): ")
adjective2 = input("Enter another adjective(description): ")
verb1 = input("Enter a verb ending with 'ing': ")
adjective3 = input("Enter another adjective(description): ")
print(f"Today I went to a {adjective1}zoo.")
print(f"In an exhibit,I saw a {noun1}")
print(f"{noun1} was {adjective2} and {verb1}")
print(f"I was {adjective3}")