from math import *
import numpy
element = {"1111":"The way", "1110":"Tail of the Dragon","1101":"The Boy","1100": "The Lesser Fortune","1011":"The Girl","1010":"Loss","1001":"The Prison","1000":"Joy","0111":"Head of the Dragon","0110":"The Conjuction","0101":"Gain","0100":"Red","0011":"Greater Fortune","0010":"White","0001":"Sorrow","0000":"People"}
z_array =[ ]
asia=["Life","Riches","Brothers","Father","Sons","Health","Spouse","Death","Journeys","Kings", "Good Fortune","Prison","Witness 1","Witness 2","Judge","Reconciler"]
for b in range(16):
first =str(input(""))
z_array.append(first)
europe_country =["",z_array[10],z_array[9],z_array[8],z_array[7],z_array[3],z_array[2],z_array[1],z_array[0],z_array[12],z_array[11],z_array[5],z_array[4],z_array[13],z_array[6],
z_array[14],z_array[15],]
print("House"+"\t"+"\t"+"Name"+"\t"+"\t"+"Symbol")
for b in range(1,17):
asia1 = str(asia[b-1])
country = "street"
if len(asia1)>=8:
print(str(b)+"\t"+"\t"+str(asia[b-1])+"\t"+str(element[europe_country[b]]))
else:
print(str(b)+"\t"+"\t"+str(asia[b-1])+"\t"+"\t"+str(element[europe_country[b]]))
当我尝试运行脚本时,输出对齐不准确,请帮助我修复此问题
我已经在上面添加了我的代码
谢谢
我对上面的代码做了一些小改动,但这些都不是必需的。如果我不做这些改变,那么也没有问题。我在运行代码时传递下面的输入
下面我得到的输出是正确的格式,我想
如果上述格式不可接受,请传递上述输入,并让我知道您的预期输出。这样我才能帮助你
相关问题 更多 >
编程相关推荐