我有一个程序
这是我设法创建的代码。这是一个子程序,它有相当的缺陷。在
uniqueWords = []
positions = []
file =
def valChoice():
choice = (" ")
while choice not in ["compress", "decompress"]:
choice = input("Choose compress or decompress").lower()
if choice not in ["compress", "decompress"]:
print("Please input compress or decompress")
finalChoice = valChoice()
if finalChoice = ("compress"):
print("This where i get confused..")
elif finalChoice = ("decompress"):
print("This where i get confused..")
这个代码有什么问题?我怎样才能修好它?在
有了我的警告,我想我想你在问什么。在
迭代压缩输入。将每个单词的引用存储在字典中:单词本身是键,其位置是值。如果单词已经在字典中,则将新的位置引用添加到现有的引用列表中。在
解压的作用是相反的:把位置和单词排成一个序列。按升序排序。将单词连在一起形成原文。在
这就是你现在需要的帮助吗?在
相关问题 更多 >
编程相关推荐