作业
1.
2.
3.
答案
def zuoye1():
names = ["jerry", "hansen", "Amy", "Wendy", "Tom", "Bob"]
list1 = [i.upper() for i in names if len(i) <= 3]
print(list1)
def zuoye2():
list1 = [i for i in range(0, 5) if i % 2 == 0]
list2 = [i for i in range(0, 5) if i % 2 == 1]
tuple1 = [(i,j) for i in list1 for j in list2]
print(tuple1)
def zuoye3():
list1 = ['Bob', 'JOHN', 'alice', 'bob', 'ALICE', 'James', 'Bob', 'JAMES', 'jAMeS']
list2 = [i.capitalize() for i in list1]
list3 = list(set(list2))
print(list3)