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

2020-01-17  本文已影响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))

上一篇下一篇

猜你喜欢

热点阅读