最近忙着学MySQL,但是小编也不会放弃学Python!!!
因为热爱所以学习~
好了各位,进入正题,由于时间问题今天学的不是很多....
#!/usr/bin/env python
# -*- coding:utf8 -*-
#input只接收字符串,需转化字符类型方可运算
inp = input ("number: ")
new_inp = int(inp)
while new_inp == 10:
num = new_inp + 90
print (num)
break
else:
print ("请输入数字10!")
#continue终止当前循环,break跳出整个循环
count = 0
while count < 10:
if count == 7:
count = count + 1
continue
print (count)
count = count + 1
#in ,not in用法
name = "我的世界"
if "世界" in name:
print('ok')
elif "阿坤" not in name:
print ('nonull')
else:
print('null')