美文网首页
1、注释/变量/数据类型(python3)

1、注释/变量/数据类型(python3)

作者: 西楼听雨 | 来源:发表于2020-01-17 00:26 被阅读0次

    单行注释

    print("hello word")

    '''
    多行注释
    print("hello word")
    print("hello word")

    '''

    定义变量

    My_Name = 'TOM'
    print(My_Name)

    数据类型 int整型 float浮点型(小数)str字符串 bool布尔型 list列表 tuple元组 set集合 dict字典

    dict 字典

    f = {'name':"tom",'age':18}
    print(type(f))

    set集合

    e ={10,23,45}
    print(type(e))

    tuple 元组

    d = (56,77,77)
    print(type(d))

    list 列表

    c = [22,33,44,55]
    print(type(c))

    bool 布尔

    b = True
    print(type(b))

    str 字符串

    a = "hello word"
    print(type(a))

    int 整型

    age = 10
    print(type(age))

    float 浮点型

    num = 2.2
    print(type(num))

    相关文章

      网友评论

          本文标题:1、注释/变量/数据类型(python3)

          本文链接:https://www.haomeiwen.com/subject/qanqzctx.html