现在的位置: 主页 > 在线留言 > 文章正文

Beginning Python From Novice to Professional (5)

作者:福州市名人视觉形象设计职业培训学校 来源:www.mrssjy.com 发布时间:2017-09-03 12:09:17
Beginning Python From Novice to Professional (5) - 条件与循环

条件与循环

条件执行:

name = raw_input('What is your name? ') if name.endswith('Gumby'): print 'Hello, Mr.Gumby'What is your name? Gumby Hello, Mr.Gumbyname = raw_input('What is your name? ') if name.endswith('Gumby'): print 'Hello, Mr.Gumby' else: print 'Hello, stranger'多个条件: num = input('Enter a number: ') if num > 0: print 'The number is positive' elif num < 0: print 'The number is negative' else: print 'The number is zero'Enter a number: 5 The number is positiveEnter a number: -1 The number is negativeEnter a number: 0 The number is zerowhile循环: x = 1 while x,站群系统

企业建站2800元起,携手武汉肥猫科技,做一个有见地的颜值派!更多优惠请戳:武汉网站设计 http://www.feimao666.com

上一篇:张小龙:不一样的产品思维 下一篇:最后一页