I Haz Codes
You are to create a program which will read in text from a file using the sample code below. The name of the text file will be “words.txt” and must be placed in the same place as your code.
myfile = open("words.txt", "r") # open file in read mode
fullTextFile = myfile.read() # read in the whole file
myfile.close() # close the file
# You now can use the variable fullTextFile as a string!
Once the text has been written in you must output the number of times each letter appears. It should be able to handle letters in a different case.
You are to do the same as the beginners task, but you will keep track of the number of times punctuation has been used.
Some links to help you –
Iterating over a string -http://www.pythonlearn.com/html-008/cfbook007.html
Representing text in a computer (ASCII)- http://www.bbc.co.uk/education/guides/zpfdwmn/revision
ASCII -http://www.teach-ict.com/gcse_computing/ocr/214_representing_data/character/miniweb/pg2.htm
Ord/chr -http://www.dotnetperls.com/ord-chr

You need to log in or create an account to submit code!
| daanish123 | james-egan |
| meelas | opage |
| twilight-sora |