Python 3.5.1 reading from a file -


i have written maths quiz school , final task requires me take scores file , order them in various ways. performing thought simple task of writing file turned out not work. can please tell me what's missing this.

with open("class a.txt", "r") f:     list(f) 

how this:

>>> open("class a.txt", "r") f: ...     content = f.read() ...     content_list = content.split('\n')  # split on space/comma/... 

read content , split using whichever delimiter have used, whether enter (\n), comma or else.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -