Welcome to Python Functions, Files, and Dictionaries

Getting Started!

In order to be successful in this course you will need to have a willingness to put in the time and engage with the material. This course has been designed with non-programming learners in mind so there is no expectation that you will know how to write code in another language. That being said, it doesn’t hurt to have experience; learners who have taken the Python for Everybody specialization will already have a familiarity with some of the content that will be in the course, and others may find it useful to take that specialization before taking this course. This course is part of a specialization and the expectation is that you have completed the first course, Python Basics .

Week by week

In week one the video lectures and the Runestone textbook will introduce you to the idea of incorporating files into your programs as an additional source of data. You will learn how to read from a file, write to a file, and how to work with the .csv data format.

In week two the video lectures and the Runestone textbook will focus on a new data type, dictionaries. You will be introduced to the mechanics of dictionaries and then get practice using them in accumulation patterns, both to build a dictionary using the pattern as well as find the best, or worst, result using the pattern.

In week three you will be introduced to the construction of functions. Up to this point, you have used functions in the programs before, but have not had a chance to write your own functions, including how to define a function, how to incorporate parameters, how to return data from a function, the local or global scope of variables, and potential side effects that could occur from function execution. Finally, we look at tuples more in depth, and how automatic packing and unpacking of tuples can be used in functions and in for loops.

In week four the video lectures and the Runestone textbook will outline a more advanced iteration mechanism, the while loop. You will be introduced to using it when getting feedback from users, as well as applying it to the turtle module to draw images. Additionally, you will also be exposed to more advanced function concepts such as the idea of parameters being optional, not required, and anonymous functions using lambda.

In week five the videos and Runestone textbook will detail how to sort python objects - both the basics and more advanced forms of sorting for dictionaries and how to break a tie (if that occurs). The final course assessment will be a project that asks you to read fake, auto-generated data from a social media site to analyze social media post sentiments. You will submit a csv file as well as images of graphs that demonstrate your findings.

Exercises

Throughout the course, there will be opportunities for you to practice your skills and test your understanding of the material so far. These are ungraded opportunities, and you can try them as much as you would like without penalty for any incorrect answers. For each lecture video, there will be an accompanying page or pages in the interactive textbook which have questions at the bottom for you to use. The questions, listed under “Check Your Understanding”, are meant to help you tell if you’re getting the main points from the material. There will also be a page at the end of almost every chapter labeled “Exercises”. There will be questions here that you can practice with, which will be more similar to a graded quiz in both structure and difficulty. Finally, there will be a practice tool that you can access, which is hosted in the textbook. With this practice tool, you can select a topic, and you will then be prompted with a question to answer. You can move on to the next question regardless of if you complete the question.

At the beginning of each lesson, there is a link that does double duty: 1) it logs you into the textbook, enabling the rest of the textbook links; 2) it takes you the Practice Tool.

Quizzes

Once per lesson, there will be a graded quiz - sometimes referred to as a chapter assessment. The quiz is meant to provide a formal assessment of your understanding, and will mostly be a mix of multiple choice, fill in the blank, and short coding questions. These graded quizzes will be hosted in the interactive textbook, and the results will be sent back to coursera automatically.

The quizzes have a due date very far in the future, just because all runestone assignments have due dates. You can ignore them. You’ll be done with this Specialization way before the due dates.

Peer Evaluation

The final project in the course will require peer-grading to evaluate the accuracy of a graph. We use peer-grading to evaluate this portion of the assignment because it is essential that the accuracy of the visuals are evaluated by a human, rather than a machine.

In order for this system to work, learners must carefully evaluate the work of their peers using a rubric that has been created by Professors Resnick and Oney and the course staff. Please read the rubric carefully and choose the options that most closely match the elements of the assignment you are grading.

Just a reminder to visit Coursera’s Code of Conduct and to abide by guidelines there. It is important when giving feedback to your peers to be polite and to be sensitive to the diversity of cultures and backgrounds of learners in your course.

Please also review Coursera’s help articles on peer reviewed assignments .

Grading Formula for Python Functions, Files, and Dictionaries

Our quizzes are all set up to give you automated feedback right away and to let you try as many times as you want until and to always grade your "best" answer (usually your last one). We've set a passing threshold of 100%, because mastery of the early material is critical to success on later material.

For the same reason, we strongly encourage you to use the practice tool every day. It's an easy way to review previous concepts and it's rewarding to see how topics that were once difficult become easy as you progress.

Passing Threshold: 100%

Week One: 20%

Week Two: 20%

Week Three: 20%

Week Four: 20%

Week Five: 20%

Getting Help

If you are having problems logging in to the interactive textbook for the course, try logging in again via the "Log in to Textbook" page for the course. This should restore your access to the interactive textbook.

If the problem is with the Coursera platform, please check out the Coursera Learner Support Forums.

If you have questions with the content of the course, or questions about programming in Python or with the toolkits described, you can contact your peers and the course instructors in the Coursera Discussion Forums . If you have more general questions about Python (i.e., not specific to operating the Runestone textbook), go to Stack Overflow.

While learning from each other is very important we all recognize the difference between collaboration and simply copying and pasting work done by others. We strongly encourage you to work collaboratively using good judgment. Similarly, please respect all copyright rules of all materials, including books, articles, etc. While we ultimately cannot monitor everything, Coursera and my team will monitor the forums for any activity that violates such codes of conduct and basic civility to each other. Participation in the discussion forum is not required, though it is strongly encouraged.

For more information, please reach out to Coursera learner support via our online chat forums in the Learner Help Center .

Accessibility

We are committed to developing accessible learning experiences for the widest possible audience. We recognize that learners with disabilities (including but not limited to visual impairments, hearing impairments, cognitive disabilities, or motor disabilities) might need more specific accessibility-related support to achieve learning goals in this course. If you experience any accessibility barriers, such as missing or inadequate alt-text, screen-reader inaccessible navigation, erroneous or incomprehensible captioning, please use this Accessibility Feedback Form to notify our team, and we will be more than happy to help.

If you encounter other types of issues such as broken links, missing course resources, specific course content errors, or questions about the platform in general, please post and request staff help in the Discussion Forums instead of using the Accessibility Feedback Form to ensure your request most efficiently reaches its intended destination.

Contact with the Instructor

Given the large number of students in this course the teaching assistants or instructor(s) should not be contacted directly with any questions. While we appreciate the time and effort you put into the course, responding to questions is virtually impossible. But teaching assistants will monitor the forums and will keep the instructor informed on a regular basis.