标签:个数 浮点型 浮点 基本 身高 print int hello name
数据类型的分类:
1、数字型:
整型(int):用于标识年龄、等级、号码、个数等。
定义:age=10,#age=int(10)
浮点型(float):用于标识体重,身高,薪资等。
定义:salary=3.1,#salary=float(3.1)
2、字符串(str):
例:name=‘egon’ #name=str(‘egon’)
# 字符串类型只能+或者*
例:msg=‘hello‘,name=‘egon’
print(msg+name)---------------->> helloegon
print(msg*5)---------------->> hellohellohellohellohello
标签:个数 浮点型 浮点 基本 身高 print int hello name
原文地址:https://www.cnblogs.com/rongge95500/p/9221480.html