Python - Basics 1
Python - Basics 1
WELCOME TO PYTHON!
1. Create a Python program with the title “FirstProgram.” In this program, create 8 variables (2 each
of int, float, string & Boolean) and have the program print all values to the console.
<COPY AND PASTE THE SOURCE CODE FOR THE PROGRAM HERE>
2. Solve for the value of these variables as they would be found in Python programming. Show all the
steps in the same way used on page 12 of the notes and be sure the result is the correct type:
apple = 2 – 5 * -1 % (15 / 2)
apple = -9.5
banana =
carrot =
3. Create a Python program with the title “FirstMath.” In this program, create 3 variables that are
integers of your choosing named length, width and height. Then create two variables that are floats
called pi (3.14) and a radius of your choosing. Then uses these variables to calculate the area of a
circle (pi*r^2), the area of a rectangle (l * w), the volume of a prism (l * w * h), the surface area of
the prism (4 * (l*w) + 2* (w * h)) and the volume of a sphere (4/3*pi*r^2). Have the program print
these values to the console. Add comments to each calculation line to say what those lines are
doing.
<COPY AND PASTE THE SOURCE CODE FOR THE PROGRAM HERE>
<COPY AND PASTE THE SOURCE CODE FOR THE PROGRAM HERE>