You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
f=open("demo.txt", "r")
#print(f.read())#Read Only Parts of the File#By default the read() method returns the whole text, but you can also specify how many character you want to return:#print(f.read(5))#Read Lines#You can return one line by using the readline() method:print(f.readline())
demo.txtHello! Welcometodemo.txtThisfileisfortestingpurposes.
GoodLuck!