---
tags: mth225, python
---
# MTH 225: Python crash course
As a basic tool for exploring mathematical ideas and applying them to computer science, we'll be using the **Python** programming language frequently in the course starting in weeks 2 or 3. You'll be learning the essentials of Python to enable you to explore math with this tool. We will be doing an **extremely minimal** treatment of Python --- in no way is it a complete introduction, and it's "just enough to be dangerous". But it will be solid, if minimal, and if you want to learn more, you'll be well set up to do so. ([CIS 161](https://cis.gvsu.edu/~wolffe/courses/cs161/docs/cs161Syllabus.pdf) is a good place to go for more Python.)
Since our coverage of Python is minimal, we will not use class time to cover it. Instead, in this assignment you'll work through parts of a self-paced course online to learn what you need to know.
:::info
**Time requirements:** This will vary widely depending on your prior experience with programming and with Python and other specifics of the assignment. **Most students in the past who have started with zero knowledge of Python (but some programming experience) have said this assignment takes a total of about 6-8 hours to complete**. This is a significant chunk of time, so the way to do this is spread it out, about half an hour a day over the course of a couple of weeks. Of course, you can go faster than that if you want.
**Value:** Completion of this assignment by the target date below will earn you **three tokens** which you can use to spend to extend deadlines, earn free Passes on some assignments, and more. It has no other direct impact on your course grade. Technically there is no penalty for non-completion. However, we will be using Python a lot in the course, including on Weekly Challenges. Therefore non-completion of this assignment may result in deficiencies that do affect you.
**If you are already fluent with Python or prefer to become fluent some other way:** Then you can skip this assignment. You do not need to demonstrate competency in some other way, but the reward of three tokens is *only* given for completing this particular assignment.
**Target date:** All work must be submitted no later than **11:59pm Eastern on Friday, September 17**.
:::
## Instructions
1. Go to http://www.codeacademy.com and create a free account, or sign in with a social media or GitHub account.
2. Then go to https://www.codecademy.com/learn/learn-python. This is a free, self-paced entry level minicourse on **Python 2**. (Do *not* sign up for the Codeacademy course on *Python 3*.) Although you may be prompted to sign up for "Codeacademy Pro", you do not need to do this to take the short course, and **you do not need to pay or give credit card information**. If you set up an account but cannot access the minicourse without giving payment information, please let me (Prof. Talbert) know.
3. The minicourse is split up into 12 units, each consisting of 1-2 lessons that are done in the browser. (No installation of anything is needed.) **Complete the first 9 units of the course: "Python Syntax" through "Exam Statistics".** (The remaining 3 units are optional; we won't use any of the material in them, in MTH 225, but you're free to go through them if you want.) When you complete a lesson, you will see a checkmark go up next to that lesson, like this: https://i.imgur.com/5ySdn7g.jpg. **You do not need to complete the "Projects" or "Quizzes" at the end of the lessons**; in fact you can't access these unless you have paid for the Pro version of Codeacademy (which you do NOT need to do).
:::warning
:warning: **Important note about Python 2 versus Python 3** :warning:
The *current* version of Python, which we will use in the class, is **Python 3** not Python 2. We are using the Codecademy course for Python 2 because it's free; the Python 3 course requires a paid subscription. **There are two especially important differences between Python 2 and Python 3** that you should be aware of as you work:
1. **The `print` command in Python 3 requires that the thing being printed goes in parentheses**; the parentheses are *not* requires in Python 2. For example in Python 3 you would type `print("Hello world")`; in Python 2 it would be `print "Hello world"`.
2. **The `/` character used for division works differently**. In Python 3, when using this command to divide two integers, it returns a decimal or floating-point result. In Python 2, it returns an *integer* result. For example in Python 3, `16/3` returns `5.3333333`. In Python 2, it would return just `5`.
There are other major differences between Python 2 and Python 3, but these two are the biggest. You'll simply have to remember to make these adjustments when doing Python in the class once this tutorial is done.
:::
## Submitting your work
**To submit your work:** When you have completed the nine units assigned above, you will just need to show me your account page at Codeacademy with all the required lessons checked off. The checkmarks on all nine units will be counted as proof of completion. You can:
- Show me your screen in person at a class meeting or drop-in hours;
- Show me your screen in a Zoom meeting; or
- Email me a screenshot of your screen that shows your name on the screen as well as all of the checks.
As long as you are getting me verifiable proof that you completed the lessons, we're good.
## Getting help
You can ask me (Talbert) for help on this assignment at any time through whatever medium (email, Campuswire, etc.) works for you.
You can also ask questions of your classmates, especially on Campuswire, but you may not use their work as your own. For academic honesty purposes, we'll treat this assignment the same as a Weekly Challenge. See the syllabus for that particular policy.
<!--stackedit_data:
eyJoaXN0b3J5IjpbLTE1ODYyMTk4NiwxMDg3MDQ0NzE3XX0=
-->

:::info Welcome to MTH 201! I'm Dr. Robert Talbert, Professor of Mathematics, and I am grateful that you are signed up for the course and am looking forward to working with you this semester. ::: What's MTH 201 all about? MTH 201 is a first course in Calculus, which is all about modeling and understanding change. Change is maybe the most important facet of the world around us, and we care about it more than we realize. For example, we care a lot about the number of Covid-19 cases in our community, but we might care even more about how fast the number of cases is changing (either up or down). In MTH 201, you'll learn the mathematical language of change and apply it to models that you build to draw conclusions, make predictions, and give meaningful answers to real problems. MTH 201 goes beyond just computation. In MTH 201, you'll build skills with understanding complex concepts, communicating those concepts and the meaning of your results to appropriate audiences, using professional tools to help you in your work, and practice working with others to improve your learning (and theirs). These are valuable skills no matter where you go next. Success in this course doesn't come easy, and you can expect to be pushed and stretched intellectually. But the struggle you experience is normal and healthy, a sign of growth and that you are doing things the right way. And you will receive tireless support from me and your classmates in the process. Above all, my top priority is to support you in your work and help you succeed.

11/11/2023Initial due date: Sunday, April 9 at 11:59pm ET Overview Our final miniproject reaches back into linear algebra to look at diagonalizable matrices and their uses in solving systems of differential equations. Prerequisites: You'll need to be able to solve basic systems of differential equations and find the eigenvalues and eigenvectors for a small matrix. You'll also need a basic comfort level with concepts of linear independence and matrix arithmetic from earlier in the course. Background This entire problem comes from Section 3.9.1 in your textbook. Here is a rephrased version of the introduction to that section.

3/29/2023Initial due date: Sunday, April 9 at 11:59pm ET Overview This miniproject will teach you about the Runge-Kutta method, a standard numerical solution technique for differential equations. Prerequisites: A strong grasp of Euler's Method for single DE's is needed. You will also need to be comfortable using a spreadsheet. Miniproject 6 (Euler's Method for systems) is also recommended. Background A description of the Runge-Kutta method along with an example is given in this tutorial. Read it carefully and make sure you can work along with the example before proceeding.

3/29/2023Initial due date: Sunday, April 9 at 11:59pm ET Overview This miniproject introduces a version of Euler's Method as a numerical solution technique for systems. Prerequisites: You will need to be comfortable with using Euler's method for single differential equations. You'll also benefit from some familiarity with spreadsheets or Python in order to automate the calculations. Background This tutorial gives you the background you need for this assignment. Please read it and make sure you understand the concepts and the example: https://github.com/RobertTalbert/linalg-diffeq/blob/main/assignments/Euler's_Method_for_Systems.ipynb

3/22/2023
Published on ** HackMD**