Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/320.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 为下面显示的每个条读取一系列标题和输入值(其中1<;=value<;=30)的程序,提示存储在两个列表中_Python - Fatal编程技术网

Python 为下面显示的每个条读取一系列标题和输入值(其中1<;=value<;=30)的程序,提示存储在两个列表中

Python 为下面显示的每个条读取一系列标题和输入值(其中1<;=value<;=30)的程序,提示存储在两个列表中,python,Python,本质上,我的问题与正确设置循环有关,以便输出类似于此。标题输入列表应该右对齐,*计数乘以每个标题的值列表输入。到目前为止,我已经对设置变量进行了大量整理: captionInput = input("Enter the caption (or -1 to stop): ") valueInput = input("Enter the value for %s: " % captionInput ) captionList = [] valueList =

本质上,我的问题与正确设置循环有关,以便输出类似于此。标题输入列表应该右对齐,*计数乘以每个标题的值列表输入。到目前为止,我已经对设置变量进行了大量整理:

captionInput = input("Enter the caption (or -1 to stop): ")
valueInput = input("Enter the value for %s: " % captionInput )
captionList = []
valueList = []
但我仍在努力解决其余的问题。我知道它需要一个while循环作为标题,很可能需要一个嵌套的for循环和值。链接图像中显示的打印输出应具有标题的“captioninput”*********
,值为zip(captionList,valueList):
打印(“{:>15s}{}”