• Python-内置数据类型


    1、字符串[string] 
    1)str=’this is string’ 
    print str 
    print type(str) 
    2)str='''想怎么些就怎么些 
    怎么的 
    '''
    print str 
    print type(str) 
    注意:单引号、双引号均可,使用三个引号,其内容可以自由书写 
    2、布尔类型[bool] 
    bool=False 
    print bool 
    bool=True 
    print bool 
    3、整数[int] 
    int=100 
    print int 
    print type(int) 
    4、浮点数[float] 
    flo=3.1415926 
    print type(flo) 
    5、元组[tuple] 
    tup=(1,2,3) 
    print tup 
    print type(tup)

    6、列表[list] 
    l=[1,2,3,4,5] 
    print l 
    print type(l)

    7、字典[dict] 
    d={1:’a’,2:’b’,3:’c’} 
    print type(d)

  • 相关阅读:
    day04 Java Web 开发入门
    day0203 XML 学习笔记
    canvas 基础
    TreeSet
    IntelliJ IDEA
    elastic-job-lite
    Spring 同一接口注入多个bean实现
    StringRedisTemplate
    小记
    linux 命令
  • 原文地址:https://www.cnblogs.com/yan-xiang/p/6593182.html
Copyright © 2020-2023  润新知