Variable = A container for a value (string, integer, float, boolean)
A Variable behaves as if it was the value it contains
由此可见,共有四种数据类型

print(f"Hello {first_name}")print("hello " + first_name){value}相当于一个占位符,格式化字符串字面值
在python中字符串变量使用引号括起来
first_name = "bro"food = "pizza"email = "32477XXXXqq.cpm"age = 24quantity = 3#整数数字price = 10.33#即浮点数(小数)is_student = True# oris_student = False#布尔型 只包含 错或者对,相当于C语言里面的0与非零# 一般配合条件语句if for_sale: print("that item is for sale") #True 执行词句else: print("that is NOT available")Typecasting = the process of converting a variable from one data type to anther str(), int(), float(), bool()
即类型转换
可以打印数据类型
name = "bro"print(type(name))<class 'str'>name = "Bro"age = 25gpa = 3.5is_student = Turegpa = int(gpa) # 3