Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
(Python)变量修改_Python_Python 3.x - Fatal编程技术网

(Python)变量修改

(Python)变量修改,python,python-3.x,Python,Python 3.x,简单的问题,看看这个代码 greeting_morning = "good morning" greeting_night = "good night" time = "morning" print(greeting_time) # should be printing good morning 这会导致一个错误 你注意到我的问题了吗 我只想打印“早上好”,但不会 如何正确修复它?问候时间是一个不存在的变量。只有以下变量可用: 打

简单的问题,看看这个代码

greeting_morning = "good morning"
greeting_night = "good night"

time = "morning"

print(greeting_time) # should be printing good morning
这会导致一个错误

你注意到我的问题了吗

我只想打印“早上好”,但不会


如何正确修复它?

问候时间是一个不存在的变量。只有以下变量可用:

打印(问候语)
是获得输出所需的操作