python学习日记-python基础2024/01/04

79 阅读1分钟

python基础

python的注释添加方法: 单行注释:# (ctrl+/) 多行注释: '''这里写注释''' 变量名的使用规范: 1、变量命名字母+数字+'_': name: '黑猫警长', name1: '花花', name_test: '小可爱' 2、不能用python类型进行命名 3、不能用数字开头 4、不能用python关键字命名

数据类型补充:空的大括号是dict

a = {}
b = {}
c = set()
print(type(a))
print(type(b))
print(type(c))
<class 'dict'>
<class 'dict'>
<class 'set'>