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

单行注释

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))

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容