Callysto.ca Banner

Module 5 Unit 3 - Functions and Graphing#

Unit Learning Objectives#

By the end of this unit, you will be able to

  • Program functions

  • Create basic graphs in a Jupyter notebook

Programming Fundamentals#

Let’s continue to explore some more programming directly in a Jupyter notebook. In this notebook, you will learn about the following programming fundamentals:

Functions

Functions are an easy way to organize code into useful blocks, allowing code to be ordered, which makes it easier to read, reuse, and save some time.

Basic Graphing

Data sets and functions can be graphed using Python. These graphs can be displayed along with text, images, video and code in the Jupyter Notebook.

External Activity: Programming Functions and Basic Graphing in Python#

Work through this Jupyter Notebook to learn about and get hands on with programming functions and basic graphing in Python. Remember to “Run” your cells.

Want to check your work - open this notebook and compare to the one you were working on.

If you enjoyed this, you may want to take a detour and keep learning about python. LearnPython is an interactive tutorial for anyone who wants to learn Python.

For even more Python learning activities, visit:

  • jerry-git/learn-python3 - Beginner and Intermediate resources in Jupyter notebook format. You can download the notebooks’ sub-folders and upload the notebook files (lessons and exercises) to your Callysto Hub account.

  • https://thepythonguru.com - A beginner Python tutorial. You can copy and paste, and run the code examples in your own Jupyter notebook.

External Activity: Drawing with Turtles! Build your first Turtle program#

M5_Unit3image

Now let’s put some of these programming features to work drawing with turtles. In these exercises, try and command the Turtle to draw the identified images by using the list of Turtle commands provided in the notebook. If you can do this easily, then try and move on and draw the more complex flower images.

Remember in order to get your Turtle to interpret your instructions you need to “Run” your code cells. Try and use the different programming concepts introduced in this module including:

  • Variables

  • Loops

  • Functions

  • Lists

Activity:

Link to Turtles Exercise notebook

Want to check your work? Open this Python notebook and compare to the one you were working on.

Link to Turtles Solution notebook

Callysto.ca License