对于函数ask,以下调用错误的是哪一项? def ask(prompt = "Do you like Python? ", hint = "yes or no"): while True: answer = input(prompt) if answer.lower() in (’y’, ’yes’): print("Thank you") return True if answer.lower() in (’n’, ’no’): print("Why not") return False else: print(hint)
A、answer.lower() 是调用了字符串自带的函数lower(),将输入转换为小写字母。
B、函数调用ask("Do you like Python? ")与ask()效果一致。
C、调用函数ask(),在交互页面输入N,则会继续打印yes or no提示你继续输入。
D、调用函数ask(),在交互页面输入x,则会打印yes or no,如果继续输入y,则会打印Thank you并退出ask()函数的执行同时返回值True。
第1题
A man named Walter Scott had the first "diner" in 1872. It wasn't really a diner. It was only a food cart. People on the street walked up to the cart to buy food. These carts served late- night workers who wanted a cup of coffee and a late-night meal. The meal was a sandwich or boiled eggs. In 1887, Samuel Jones built the first diner big enough to allow the customers to come inside. However, they did not sit down. Later, people built diners with counters and stools, and people sat down while they ate.
Before long many diners stayed open around the clock. In other words, people were able to eat in a diner at any time. Diners changed in other ways, too. The original menu of sandwiches and coffee became bigger. It included soup, favorite dishes, and a breakfast menu. In addition, diners soon became permanent buildings. They were no longer carts on wheels.
Diners today look similar to the diners of the early 1990s. They are usually buildings with large windows. Inside, the diners have shining counters with stools, meals in a modern diner.
Today, many people eat in fast-food restaurants such as McDonald's and Burger King. However, the diner remains an American tradition, and thousands of people still enjoy eating there. It was popular a century ago, and it is still popular today.
A man named Walter Scott had the first "diner" in 1872. Why is diner in quotation marks (引号) ?
A.Because it is spelled differently from "dinner".
B.Because the first diner was not a real diner.
C.Because the first diner was a real diner.
D.Because it is a special kind of restaurant.
第2题
A.feel like
B.felt like
C.feel like to
D.feel liked
第3题
A.feel like
B.felt like
C.feel like to
D.feel liked
第4题
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!