WSQ09 – Multipart Data and Files

Files flickr photo by T a k shared under a Creative Commons (BY-NC) license

Your Assignment

So for this assignment I would like to see you create a function that receives as parameter the name of a file (this would be a string value like data.txt) and your function counts the number of lines and the number of characters in the file which it returns as a single value (but with two values). You will want to look at how to use and return a tuple from a function and how to open and read text files line by line.

What To Submit

As always a blog post, tag with #WSQ09 and perhaps put your code up on GitHub. Ask for help or input via Slack in our #tc1014gda channel.

Feature Image Credit

<a title="Files" href="https://flickr.com/photos/takashi/18862634">Files</a> flickr photo by <a href="https://flickr.com/people/takashi">T a k</a> shared under a <a href="https://creativecommons.org/licenses/by-nc/2.0/">Creative Commons (BY-NC) license</a> </small>
Files flickr photo by T a k shared under a Creative Commons (BY-NC) license

CC BY-SA 4.0 WSQ09 – Multipart Data and Files by admin is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.