【python】-编程练习

退出程序:

exit();

打印索引:

for  index,pp  in enumerate(list):

print(index,pp)

判断是否为数字:

var.isdigit()

类型转换:

var=int(var)

输出标记颜色:

33[31;1m  需要标记颜色的文字 33[0m

注意:

前边开后边关

中间有个分号

31是红色

32是绿色

41是背景加红

42是背景加绿色

原文地址:https://www.cnblogs.com/linalove/p/8434690.html