num_plate = ['渝A9919','渝C5072','渝A2966','渝D8371','渝A3417','渝A5255','渝AD9919']
#今天的作业是7月15日(明天)按单双号出行,哪些车牌可以上路?
for plate in num_plate:
if eval(plate[-1])%2==0:
print(plate)
my_fruit = ['watemelon','apple','mango','banana','peach']
for i in my_fruit:
if i == 'banan':
print(i)
else:
print(None)
your_fruit = ['pear','strawberry','pear','mango']
print(my_fruit[::1]) #slice
print('slice-even:',list(range(1,100))[::2])
print([i for i in range(100) if i%2==0])
print(set(my_fruit) & set(your_fruit))
网友评论