#麻烦办法
new_lst = []
for i in range(10):
new_lst.append(i**2)
print(new_lst)
#简单办法
print([i**2 for i in range(10)])
# 小题下面列表中取余
list_a = [1,2,3,-5,20,-7]
print([i%2 for i in list_a])
# 30以内所有能被3整除的数
print([won for won in range(30) if won%3 == 0])
# 题目
names = [['Tom', 'Billy', 'Jefferson', 'Andrew', 'Wesley', 'Steven', 'Joe'],
['Alice', 'Jill', 'Ana', 'Wendy', 'Jennifer', 'Sherry', 'Eva']]
print([i for name_list in names for i in name_list if i.count('e') == 2])