数据类型(补)

3.布尔(bool)表示对和错,真和假    True    False      [条件判断]

    type(变量)告诉你这个变量是什么类型

    a="周润发"

    print(type(a))      #打印a的数据类型→str

    b=128

   print(type(b))→int

    c=True

    print(type(c))

    a=1  

    b=2

    print(a+b)           #2

    a='1'               #字符串

    b='2'               #字符串

    #两个字符串相加是字符串连接

    print(a+b)        #字符串"11"

    a="隐王"

    print(a*3)         #*表示乘以几遍

posted on 2019-05-29 21:13  哇噻噻  阅读(109)  评论(0)    收藏  举报