1. 数字类型
1.1 整型(int)
age = 18
print(type(age)) # <class 'int'>
1.2 浮点型(float)
height = 1.87
print(type(height)) # <class 'float'>
int 和 float 可以互相相加
2. 字符串类型
作用:记录描述性质的状态,名字、一段话
定义:用引号(’’,"",’’’ ‘’’,""" “”")包含的一串字符串
name = '程序猿过家家'
name = "程序猿过家家"
name = '''程序猿过家家'''
name = """程序猿过家家"""
# 以上四句代码意义相同,当一行代码需要使用多对引号,程序中需要交替使用。