Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/336.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.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_String_While Loop_Ascii - Fatal编程技术网

Python,字符串正在输出;没有;?

Python,字符串正在输出;没有;?,python,string,while-loop,ascii,Python,String,While Loop,Ascii,我在一个字符串中循环,将ASCII值加1,但在最后,这个“无”弹出。这是什么 str_numbers = input ('> ') i=0 while i <len(str_numbers): x = print(chr(ord(str_numbers[i]) + 1), end="") i=i+1 print (x) str_numbers=input('>')) i=0 而iprint()不会返回任何内容。因为它没有,所以它默认

我在一个字符串中循环,将ASCII值加1,但在最后,这个“无”弹出。这是什么

str_numbers = input ('> ')

i=0

while i <len(str_numbers):
    x = print(chr(ord(str_numbers[i]) + 1), end="")
    i=i+1
    
print (x)
str_numbers=input('>'))
i=0
而i
print()
不会返回任何内容。因为它没有,所以它默认返回
None
。这就是为什么在打印x时,不会显示任何内容

但是,它仍然在
x=print(chr(ord(str_number[i])+1),end=“”)处打印项目。


去掉作业(即
x=
和之后的
print(x)

为什么我的问题被否决了?