no message

This commit is contained in:
yinjun.chen1
2026-09-17 11:10:08 +08:00
parent 6a5d16fbae
commit fd8877043b
2 changed files with 4 additions and 1 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
a=input("请输入您的年龄") a=input("请输入您的年龄")
print(eval(a),type(a),type(eval('11'))) print(eval(a),type(a),type(eval(a)))
# type(a) 等价于 type('88'),即返回值为:<class 'str'> # type(a) 等价于 type('88'),即返回值为:<class 'str'>
# eval() 不是"取值",而是"把字符串当代码跑"
print("--------------") print("--------------")
b="北京欢迎您!" b="北京欢迎您!"
print(eval('b'),type(eval('b'))) print(eval('b'),type(eval('b')))
+2
View File
@@ -0,0 +1,2 @@
bol1 = "hello"
print(eval(bol1))