top of page
Writer's pictureCade.M

E Books and coding

Updated: Sep 6, 2019

On our maths and logic fundamentals lessons, we looked at eBooks and coding. Leigh provided us a website to download free eBooks, Gutenberg We had to download one eBook in .txt. How I went about that was I did CTRL + A (which highlights all the words), opened up a notepad file then copied and pasted all the words from the book I seletcted. I selected a book called: Count of Monte Cristo. I struggled a fair amount of the work, it honestly frustrated me at times. With that being said, here is the final piece (written in Python) for the coding for Count of Monte Cristo:


There syntax errors on my end. I had to line up the if statements and for loops correctly. I also wrote the 'line replace' code twice which was unnecessary. I had help from 2 friends and a teacher.


The coding was finished and I checked the eBook from Notepad. Little did I know I repeated this 4 times:

Despite that, the words were replaced. Moving onto the next task


The second task was essentially a word finder and word replacement. We produced the coding and took another eBook from Gutenberg. I downloaded The Adventures of Sherlock Holmes.





I typed it all of the coding onto Python. Two problems that occurred were the typos from the running program and the directory issue. I had to put the coding file and the eBook onto the same file to prevent this from happen. My teacher, Leigh helped me out with the coding. He noticed that the code wasn't next to the file or pointing to it, it's compulsory for one of the other. If you put the directory in front of it, it'll notice the eBook from there.

With that being said, here is my final piece of the coding:


Overall, I struggled a lot but I found it to be fun to some extent.

1 view0 comments

Recent Posts

See All

留言


bottom of page