Posts by Mais um • 59 points
4 posts
-
1
votes1
answer140
viewsQ: Save amount of occurrences of a txt file to another python txt file
This part of the code counts the number of times words repeat in the text: with open('/Users/DIGITAL/Desktop/Python/teste.txt') as f: ocorrencias = Counter(f.read().split()) This part is used to…
-
0
votes1
answer931
viewsQ: I want to save in a new txt file a copy of another txt in Python
arq = open("/Users/DIGITAL/Desktop/Python/novo.txt", "w") arq.write(palavras) arq.close() I’m using this code, but it only accepts string.
-
1
votes1
answer435
viewsQ: Quicksort in ascending order in Python
I need to sort the number of times words repeat in the txt file, but every time I run the code it prints in descending order. Code below: from collections import Counter with…
-
3
votes2
answers407
viewsQ: How to correlate files from two txt files in Python
I would like to know a way to correlate equal words in different txt files. It will read the words of a txt file and look for those words in the other txt file.