Crossin的编程教室

标题: python入门第五课 [打印本页]

作者: 落梦    时间: 2019-11-6 20:49
标题: python入门第五课
代码如下:
num= 123.456
print (num)
num=("hello")
print("who do you think l am ?")
you= eval(input())
you= ("oh yes! l am a")
print (you)

分割线----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
运行结果:
123.456
who do you think l am ?
"nice guy"
oh yes! l am a

问:为什么程序没有回答“oh yes l am a nice guy”
作者: crossin先生    时间: 2019-11-7 15:16
you= ("oh yes! l am a")
应该是
print("oh yes! l am a")




欢迎光临 Crossin的编程教室 (https://bbs.crossincode.com/) Powered by Discuz! X2.5