我有个程序
下面是我成功创建的代码。这是一个子程序,它有相当大的缺陷。
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..")这个代码有什么问题?我怎么才能修好它?
发布于 2016-02-05 22:26:41
有了我上面的警告,我会尝试一下我认为你要求的东西。
若要压缩文件,请迭代输入单词。将每个单词引用存储在字典中:单词本身是关键,它的位置是值。如果单词已经在字典中,那么将新的位置引用添加到现有的引用列表中。
解压缩工作的反向:制定一系列的立场和文字。将该序列按升序排序。将单词连在一起,以制作原始文本。
这就是你现在需要的帮助水平吗?
https://stackoverflow.com/questions/35234456
复制相似问题