對(duì)于函數(shù)ask,以下調(diào)用錯(cuò)誤的是哪一項(xiàng) 1. def ask(prompt = "Do you like Python? ", hint = "yes or no"): 2. while True: 3. answer = input(prompt) 4. if answer.lower() in (’y’, ’yes’): 5. print ("Thank you") 6. return True 7. if answer.lower() in (’n’, ’no’): 8. print("Why not ") 9. return False 10. else: 11. print(hint)
A、answer.lower() 是調(diào)用了string自帶函數(shù)lower(),將輸入轉(zhuǎn)換為小寫字母。
B、調(diào)用函數(shù)ask(),在交互頁面輸入N,則會(huì)繼續(xù)打印yes or no提示你繼續(xù)輸入。
C、調(diào)用函數(shù)ask(),在交互頁面輸入x,則會(huì)打印yes or no,如果繼續(xù)輸入y,則會(huì)打印Thank you并退出ask()函數(shù)的執(zhí)行同時(shí)返回值True。
D、函數(shù)調(diào)用ask("Do you like Python? ")與ask()效果一致
第1題
A、answer.lower() 是調(diào)用了字符串自帶的函數(shù)lower(),將輸入轉(zhuǎn)換為小寫字母。
B、函數(shù)調(diào)用ask("Do you like Python? ")與ask()效果一致。
C、調(diào)用函數(shù)ask(),在交互頁面輸入N,則會(huì)繼續(xù)打印yes or no提示你繼續(xù)輸入。
D、調(diào)用函數(shù)ask(),在交互頁面輸入x,則會(huì)打印yes or no,如果繼續(xù)輸入y,則會(huì)打印Thank you并退出ask()函數(shù)的執(zhí)行同時(shí)返回值True。
第2題
【ask函數(shù)第1題】對(duì)于函數(shù)ask,請(qǐng)?zhí)顚懴旅娴谝粭l橫線上的答案,使得運(yùn)行情況成立,并且使得滿足出現(xiàn)題目中的上下文的提問回答。 def ask(prompt, hint = "yes or no", chance = _______): while chance > 0: 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: chance -= 1 print(________) print("Sorry, you have tried too many times.") >>> ask("Do you like SciPy?") Do you like SciPy? What? yes or no Do you like SciPy? en yes or no Sorry, you have tried too many times.
第3題
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 (引號(hào)) ?
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.
第4題
一It's very good. 1 like it.
A. Right
B. Wrong
第5題
A.What about you?
B.Would you like black tea?
C.Do you have any eggs,madam?
D.Would you like something to eat?
E.Black tea or iced tea?
F.Can I help you?
G.Thank you very much.
H.It is very tasty.
第 56 題 Woman: 1
Ben:Yes,madam.What would you like to drink,Tony?
Tony:I'd like some tea.
Ben: 2
Tony:Iced tea,please. 3
Ben:I'd like some lemonade. 4
Tony:Yes,I'd like a pizza,please.
Woann:What would you like on it,sir?
Tony:Mushrooms,green peppers and onions,please.
Ben:All right, 5
Woman:Yes.
Ben:We want a cup of iced tea,a glass of milk,a glass of lemonade,a pizza and two eggs,please.
Woman:OK.
第6題
Why do you like someone?That person may not be great looking if you take a poll,but someone falls(1)him/her immediately.Why do this happen?What is the chemistry?Why do you find someone attractive?What is the(2)of that?Many love stories have been written around the love at first sight.The prince saw the princess and the princess saw the prince.Both(3)in love with each other forever.This is what romance is made(4). What is this and how does this happen?You manage to lose your(5);your thinking ability and your head.Your heart con-trols everythin9.You try every way possible to meet and win over that person.You pass sleep-less nights(6)of him/her.You are not able to live without that person for a moment.Much has been written about romantic love.No one has(7)any conclusion about how such love devclops.There are different theories about it,but can love be ever defined in terms of chemicals?Ultimately what will science achieve by(8)about how and why of such ro-mantic love that is heavenly?The best thing if you fall in(9)love is to preserve it carefully.(10)no circumstances,let anything happen to destroy it.It is very precious.Take care of it.
1.
A.for
B.at
C.on
D.down
為了保護(hù)您的賬號(hào)安全,請(qǐng)?jiān)凇?span>上學(xué)吧”公眾號(hào)進(jìn)行驗(yàn)證,點(diǎn)擊“官網(wǎng)服務(wù)”-“賬號(hào)驗(yàn)證”后輸入驗(yàn)證碼“”完成驗(yàn)證,驗(yàn)證成功后方可繼續(xù)查看答案!