0
def print_game(Guesses, Clues):
"""(list,list) -> display
Print to display headers, Guess and Clue,
with the corresponding sublists of the given lists
>>>print_game(guesses,clues)
Guesses Clues
o o o o b
r r r r b b
"""
print("Guesses \t Clues")
for i in range((len(Guesses))):
print (Guesses[i], end=" ")
print ("\t", end=" ")
for i in range(len(Clues)):
print (Clues[i], end= " ")
我需要的功能,產生猜測和線索的兩列這將是列表的列表打印爲他們列表的Python的格式列表
它似乎繼續作爲無效 – Deka 2014-10-19 00:40:13
我認爲是因爲這個sep ='\ t' – Deka 2014-10-19 00:41:22
@Deka:'sep ='\ t''只是在不同的參數之間加上tab(print())。如果你的代碼檢查器認爲這是無效的,也許你不應該使用製表符而是實際空格。例如''sep ='''。 – 2014-10-19 00:46:43