Reading and Writing! – Basic Ones

--Originally published at TC101 – Peaz Cooper

Well well well! First of all! Ask yourself the following questions:

Do you know how to read on python? Maybe writing in python? In cChinese Japanese? Together we will learn the answers to these awesome and mind-blowing questions!


The syntax is pretty simple; again we have read me and we’re gonna open our new example filled text

readMe = open(‘exampleFile.txt’)

What do we want to do with it? What are our intentions and that’s going to be our for read and then we can go ahead and actually do ” .read “and that will actually read the file into that variable and now we can do print “read me”.

readMe = open(‘exampleFile.txt’,‘r’).read()

print(readMe)

So we can save and run that and you can see that our output is indeed that information.

Check out this YT video for a detail explanation: https://www.youtube.com/watch?v=YV6qm6erphk


If you follow these steps you’ll be coding like a bawse in no time!!!

#PeazCooperOut #TC101