IDLE and Basics of Python Programming

In this lab students explore the basics of Python. Using the Python Interpreter in IDLE, students create a series of programs that cover performing mathematical calculations and concatenation with strings. After building a program to calculate information about a particular sphere, students get to create their own project based on the premise of planning a trip to Europe. This activity is ideal for students who are both new to programming and new to Python.

Vending Machine

In this project students work independently to create a vending machine program. Using fundamental programming constructs, such as variables and conditionals, and a greedy algorithm (http://en.wikipedia.org/wiki/Greedy_algorithm), students are to construct a program that calculates the minimum number of coins necessary to make change for a particular purchase. This program introduces the concept of a greedy algorithm within the context of an example that is well-known among computer scientists (i.e. making change). The project is ideal for students who are both new to algorithms and are looking for practice with fundamental programming constructs.

Garden 2

In this project students work independently or collaboratively to calculate the area and volume of an ornamental garden. Using standard mathematical formulas in Python to calculate the area and volume of a pre-defined square plot, the students must build a program that calculates information such as the side length of the finished garden and the recommended spacing between plants. The students must use a variety of functions (such as input(), round(), and print()) to evaluate the user's input and return the proper results. As a project for primarily CS1 students, the problems outlined in the activity are suited for those with experience implementing functions and some level of comfort with implementing basic arithmetic in a programming environment. For students with limited mathematical experience this is a great way to add context around math and programming.

Engagement Excellence

Tones

In this project students create a Tone program. Using Python and knowledge of math functions, students must design a program that prompts the user for three octpch pairs. The program will convert the octpch pair into the Hz result and print the results. Optionally, the program can play the three notes using the Windows Beep function which is described at the end of the document. This assignment is particularly useful for students who are new to creating mathematical functions in Python.

Subscribe to PDF