Discuss / Python / Homework

Homework

Topic source

_JasonTong

#1 Created at ... [Delete] [Delete and Lock User]

Exercise 1

def by_name(t):
# 适用于名字和成绩排序不固定的tuple
    for x in t:
        if isinstance(x, str):
            return x

Exercise 2

def by_name(t):
# 适用于名字和成绩排序不固定的tuple
    for x in t:
        if isinstance(x, int):
            return x

  • 1

Reply