Premium Essay

It and That

In: Computers and Technology

Submitted By msr891
Words 497
Pages 2
Insructions for the shapes and area/circumfrence finding programming assignment:

Step 1) First we need to create a list of 3 shapes. To do that, we need to import a library (a group of preset functions) called math: to do that we simply say: import math

Step 2) Then we need to tell the user of our program that we are going to be creating a list of three shapes: so we say: print("Let's create a list of three shapes...")

Step 3) next we need to name our shapes 3 variables: I will name thm shape1, shape2, and shape3. We need to get the user to input the three shapes: so we type shape1 = input("Enter first shape: ") shape2 = input("Enter the second shape: ") shape3 = input("Enter the third shape: ")

Step 4) next we need to create and print out a list of the three shapes the user inputed: so we type:

list = [shape1, shape2, shape3] print(list) So, the first half (list of three shapes) should look like this:

import math print("Let's create a list of three shapes...") shape1 = input("Enter first shape: ") shape2 = input("Enter the second shape: ") shape3 = input("Enter the third shape: ") list = [shape1, shape2, shape3] print(list) Step 5) Lets move on to the second half: we need to find the are and circumfrence of a circle. First we need to know the formula (or algorithm) to find the area/ circumfrence of a circle.

Step 6) We need to tell the user that we are going to find the area and circumfrence of a circle... so we say: print("\nNow, let's find the circumference and area of a circle...")

Step 7) Next we need to get the user to input the radius of the circle that they want to find the circumfrence and area for: we need the radius to be entered as a specific type of data called a float (a number with decimals) so we type: rad = float(input("Enter radius: "))

Step 8) Now we need to compute the circumfrence: we now

Similar Documents