首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >python语言 lists求和~?

python语言 lists求和~?

提问于 2020-05-04 00:16:26
回答 0关注 0查看 234

原本题目是这样的:

A zoo in Guangzhou determines the prices of each ticket based on the age of the customer. Customers 2 years of age and less are given a free ticket. Children between 3 and 12 years of age (inclusive) cost $14.00 per ticket. Seniors aged 65 years (inclusive) and over cost $18.00 per ticket. The ticket price for all other guests is $23.00.

Create a program that begins by asking for the age of all of the guests in a group with one age entered on each line. The user will enter a blank line to indicate that there are no more guests in the group. Then your program should display the admission cost for the group with an appropriate message。

通过某道翻译如下:

广州一家动物园根据顾客的年龄来决定每张门票的价格。2岁及以下的顾客可免费获赠门票一张。3至12岁的儿童(含)票价为每张$14.00。65岁(含65岁)以上的老年人票价为每张18.00美元。所有其他客人的票价是23美元。创建一个程序,首先要求在每一行输入一个年龄的所有客人的年龄。用户将输入一个空白行,以指示组中没有更多的来宾。然后,您的程序应该用适当的消息显示该组的入场费(求出随机输入年龄的票价费用总和即可)。

这是目前写出来的
这是目前写出来的

计算机老师说,最后一个没有要求写出来,不太会~~求各位大神帮助改正

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档