标签:pytho coding 学python 字符类型 mysq span lse class ==
#!/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‘)
标签:pytho coding 学python 字符类型 mysq span lse class ==
原文地址:https://www.cnblogs.com/tomcache/p/11441113.html