I have to write a program without using list(as I still haven’t learnt them) to take 10 names as the input and put them all in lower-case and then capitalize the first letter. I came up with two programs that both work; However, there are some problem! the first programs is: in the above program I can only take the
Tag: readlines
Function failing to update spacing after comma
I have a csv file that has inconsistent spacing after the comma, like this: 534323, 93495443,34234234, 3523423423, 2342342,236555, 6564354344 I have written a function that tries to read in the file and makes the spacing consistent, but it doesn’t appear to update anything. After opening the new file created, there is no difference from the original. The function I’ve written
Counting word frequency and making a dictionary from it
I want to take every word from a text file, and count the word frequency in a dictionary. Example: ‘this is the textfile, and it is used to take words and count’ I am not that far, but I just can’t see how to complete it. My code so far: Answer If you don’t want to use collections.Counter, you can