1、Python语言特性

1、python是按照顺序执行的语言

def count1():
    print("this is count1")
    count2()

count1()

def count2():
    print("this is count2")

结果为:

NameError: name 'count2' is not defined

2、基本数据类型

int----str----bool----list----float

注意:string转换成bool类型

bool("True")
True

bool("False")
True

bool("hello")
True

bool("")
False

bool(0)
False

猜你喜欢

转载自www.cnblogs.com/Stephanie-boke/p/11711313.html