您的位置:首页 > 编程语言 > Python开发

python实例 条件和循环语句

2019-07-25 14:02 357 查看
原文链接:http://www.cnblogs.com/fanweisheng/p/11243862.html

#! /usr/bin/python
#条件和循环语句

x=int(input("Please enter an integer:"))
if x<0:
    x=0
    print ("Negative changed to zero")

elif x==0:
    print ("Zero")

else:
    print ("More")


# Loops List
a = ['cat', 'window', 'defenestrate']
for x in a:
    print (x, len(x))

#知识点:

#    * 条件和循环语句
#    * 如何得到控制台输入

转载于:https://www.cnblogs.com/fanweisheng/p/11243862.html

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: