我是python的新手。我有一个问题要问我:
到目前为止的代码:
lapcount = 0
laps=int(input("Completed Laps: "))
numlaps = (lapcount+laps)
for i in range(laps):
seconds = int(input('Seconds: '))
答案 0 :(得分:0)
使用列表存储每圈的秒数。然后使用python构建方法获取max
,min
和平均值。
例如:
laps=int(input("Completed Laps: "))
numlaps = []
for i in range(laps):
numlaps.append(int(input('Seconds: ')))
print(max(numlaps))
print(min(numlaps))
print(sum(numlaps)/laps)