标签:code 字母 from 执行 else 下划线 print return 开头
定义世间万物事物的状态
‘‘‘
height 180
weight 140
age 18
tree_name jzm
‘‘‘
变量名(描述意义;接收变量值)赋值符号( = 即赋值,把变量值传给变量名)变量值(具体的值)
height = 180
print(‘height:‘, height)
weight = 140
print(‘weight:‘, weight)
age = 18
print(‘age:‘, age)
tree_name = ‘jzm‘
print(‘tree_name:‘, tree_name)
# $ = 10
# print($)
# 10tree = 10
# print(10tree)
‘‘‘
[‘and‘, ‘as‘, ‘assert‘, ‘break‘, ‘class‘, ‘continue‘, ‘def‘, ‘del‘, ‘elif‘, ‘else‘, ‘except‘, ‘exec‘,
‘finally‘, ‘for‘, ‘from‘, ‘global‘, ‘if‘, ‘import‘, ‘in‘, ‘is‘, ‘lambda‘, ‘not‘, ‘or‘, ‘pass‘,
‘print‘, ‘raise‘, ‘return‘, ‘try‘, ‘while‘, ‘with‘, ‘yield‘]
‘‘‘
# print = 10
# print(print)
代码至上而下运行,如果相同的变量名,执行后者
下划线一般用来连接单词
(下划线和驼峰体--》多个单词做变量名的问题)
name_of_nick = ‘nick‘ #下划线式,python程序员的习惯
NameOfJason = ‘jason‘ #驼峰体式
print(name_of_nick) # 先定义才能使用,没有引号的就是变量名
age = 10
# 打印值 value
print(age)
# 打印内存地址 id
print(id(age))
# 打印数据类型() type
print(type(age))
# 不变化的量(变量名全大写),不变化是约定俗成的
AGE = 1
print(AGE)
标签:code 字母 from 执行 else 下划线 print return 开头
原文地址:https://www.cnblogs.com/jzm1201/p/12590434.html