所以我遇到的这个新问题就是这个。我有两个列表,每个列表有五个项目。从五个项目列表中除了第二个项目之外的所有项目都打印出两个列表Python
listone = ['water', 'wind', 'earth', 'fire', 'ice']
listtwo = ['one', 'two', 'three', 'four', 'five']
我想要做的就是打印字符串中的第一,第二,第三和第五,从每个列表的项目:
print("the number is %s the element is %s" % (listtwo, listone)
但是他们需要在一个新行每次打印以便为两个列表中的每个元素运行文本:
the number is one the element is water
the number is two the element is wind
the number is three the element is earth
the number is five the element is five
我不知道如何做到这一点。我尝试使用列表拆分,但自从它的五分之四我无法弄清楚如何跳过它。此外,我用这个列表的字符串一个新行:
for x in listone and listtwo:
print("the number is {0} the element is {0}".format(x)
但我不知道如何与两个列表使用或者如果它甚至可以用两个列表中。
请帮助:(
编辑:
此外,我不知道是什么脚本的元素,所以我只能用自己的号码列表中的所以我需要摆脱[。 4]在这两个列表。
我爱你。哈哈哈,但没有认真的这完美的作品,这是一个巨大的帮助。非常感谢你 – Adilicious