python 代码片段13

#coding=utf-8

# 条件转化

data=raw_input("enter 'y' or 'n'")
if data[0]=='y':
	print "you typed y."
elif data[0]=='n':
	print "you typed n."
else:
	print 'invalid key entered!'

# 循环
i=0
while i<5:
	print i
	i+=1
原文地址:https://www.cnblogs.com/yufenghou/p/5100062.html