标签:break print 严格 conf 命名 模块 python ant sys.path
s13day1第一堂课2、import 用来引入模块
比如引入sys模块,查看当前python的全局环境变量
import sys
print(sys.path)
3、判断语句
if elif else 后面以冒号结尾连接下一行 严格的缩进(4个空格)
几个例子:
###guess age
counter = 0
age = 28
for i in range(10):
if counter < 3:
print("------>counter",counter)
guess_num = int(input("input your guess num:"))
if guess_num == age :
print("Congratulations! you get it!")
break
elif guess_num > age:
print("think smaller!")
else:
print("think big!")
else:
continue_confirm = input("Do you want to continue play?")
if continue_confirm == ‘yes‘:
counter = 0
continue
else:
print("bye")
break
counter += 1
标签:break print 严格 conf 命名 模块 python ant sys.path
原文地址:http://blog.51cto.com/20has/2130011