简单交互

print("What's your name?")
name = input("Enter your name here: ")
print(f"Hi, {name}.")
print(f"Your name length is: {len(name)}")
print("How old are you?")
age = int(input("Enter your age here: "))
print(f"You are {int(age) + 1} one years later.")
result:

What's your name?
Enter your name here: Johnson
Hi, Johnson.
Your name length is: 7
How old are you?
Enter your age here: 99
You are 100 one years later.

posted @ 2024-05-26 11:01  乱串的鱼  阅读(2)  评论(0编辑  收藏  举报