Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

Administrator / lesson11_5

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • lesson11_5
  • swim.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    save project · 86a20100
    BellCodeEditor committed 4 years ago
    86a20100
swim.py 458 Bytes
Edit
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
def new_input():
    point=[]
    while True:
        swimmer=input("请输入")
        if swimmer=="q":
            break
        try:
            swimmer=int(swimmer)
        except ValueError:
            print("请输入数字")
        else:
            point.append(swimmer)
    return point
def sum(a):
    point2=0
    for i in a:
        point2+=i
    print("这位选手的总分数为:"+str(point2))
sum(new_input())