# -*- coding:utf-8 -*-
#1.判断顾客是否能够上地铁,从键盘输入顾客所带物品的名称,判断如果没有易燃易爆物,则允许上地铁,否则不允许.
# yryb=('煤气罐','打火机','酒精','汽油','烟花','爆竹')
# goods=input("请输入顾客所带物品:")
# if goods in yryb:
# print('不能上地铁')
# else:
# print('允许上地铁')
# 2.使用for 循环打印三角形
# for i in range(1,6):
# a=i*' *'
# print(a)
#3.用for语句和continue输出结果:1 3 5 7 9
# for i in range(1,10):
# if i%2==0:
# continue
# print(i)
# 4.假设有列表students=['jack','tom','john','amy','kim','sunny'],用for if else 的方法查找学员'amy'是否在列表student里,
# 如果在的话,输出字符串'find',如果不存在的话,输出字符串'not find'
# students=['jack','tom','john','amy','kim','sunny']
# if 'amy' in students:
# print('find')
# else:
# print('no find')
#5.使用while,完成以下图形的输出
# for i in range(1,6):
# a = i * ' *'
# print(a)
# while i==5:
# for i in range(4,0,-1):
# a = i * ' *'
# print(a)
转载于:https://www.cnblogs.com/gwj23/p/10604443.html