我想知道当用户输入“英文”,“西班牙文”或“两者”时是否有人可以提供帮助,它打印出没有括号和语音标记的列表,我只想要逗号。我试过四处寻找,但没有为我的代码工作。任何帮助将非常感激。Python上没有括号的打印列表
english_list = ["fire","apple","morning","river"]
spanish_list = ["fuego","manzana","manana","rio"]
english_to_spanish = dict(zip(english_list, spanish_list))
spanish_to_english = dict(zip(spanish_list, english_list))
def viewwordlist():
if word == 'show':
wordlist = input("""
Type 'English' to view the English word list
Type 'Spanish' to view the Spanish word list
Type 'Both' to view both of the word lists
""").lower().strip()
if wordlist == 'english':
print("Here is the current English word list:")
print(english_list)
elif wordlist == 'spanish':
print("Here is the current Spanish word list:")
print(spanish_list)
elif wordlist == 'both':
print("Here is both the current English and Spanish word list:")
print("Current English list:")
print(english_list)
print("Current Spanish list:")
print(spanish_list)
else:
print("Sorry, that wasn't a option. If you need some assistance please enter 'help'")
而不是描述bing你想要的输出,向我们展示确切的期望样本输出。 – abarnert 2014-10-06 22:49:54