题目内容 (请给出正确答案)
[主观题]

对于函数ask,以下调用错误的是哪一项? def ask(prompt = "Do you like Python? ", hint = "yes o

对于函数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。

暂无答案
如搜索结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能会需要:
您的账号:
发送账号密码至手机
发送
更多“对于函数ask,以下调用错误的是哪一项? def ask(p…”相关的问题

第1题

Do you like to eat out? Do you like to eat quickly? Do you like expensive food? Some people go to fast-food restaurants for these reasons. In the past, people usually went to diners (路边小餐馆) for these reasons. In fact, many people in the States still go to diners today for the same reasons.

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题

"Do you ______ a drink?" asked the man of the woman.

A.feel like

B.felt like

C.feel like to

D.feel liked

点击查看答案

第3题

"Do you ______ a drink?" asked the man of the woman.

A.feel like

B.felt like

C.feel like to

D.feel liked

点击查看答案

第4题

Complete each conversation with Would you like / Do you like or I like / I’d like . 1 ______________ a coffee —No, thanks. I don’t drink coffee. 2 _____________ spicy food — Yes. I love it! 3 ______________ a slice of cake — Yes, please. 4 Can I help you — Yes, ________ a table for two, please. 5 How’s your dessert — Good! ________ cake, especially chocolate cake. ()

点击查看答案
热门考试 全部 >
相关试卷 全部 >
账号:
你好,尊敬的上学吧用户
发送账号至手机
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
谢谢您的反馈

您认为本题答案有误,我们将认真、仔细核查,
如果您知道正确答案,欢迎您来纠错

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
上学吧
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反上学吧购买须知被冻结。您可在“上学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
上学吧
点击打开微信