Exercises
Unit 0
Directions: Create a Python Program using the information given in the following problems. Make sure your output matches the example for each exercise
Saving Form Files to Disk or Uploading: Class Names using this name convention. The first problem below you will save as U0EX2. Meaning, Unit 0 Exercise 2.
Make sure you have typed your name and unit/exercise like in a comment section like:
#Your Name
#U1EX2
your programmig stuff
Exercises
1. Write a program
that produces a square of asterisks on
the screen:
********
* *
* *
********
2. Write a program
that displays your name, class and school information:
Mike Bidwrong
Senior
The
3. In the first week
of the season the jogging club ran the following number of miles each day: 2,
3, 5, 3, 4. Write a program to calculate
(the program adds the numbers) and print the total mileage for the week:
Mileage for the first week is 17
4. The Chemistry
department has 4 computers, the Physics department has 8, the Music department
has 2 and the Math lab has 12. Write a program that produces the following
chart: ( Use the \t for tabbing)
Chemistry 4
Physics 8
Music 2
Math lab 12
Total computers 26
Have the
computer perform the calculation in the last line.
5. Marty's Music
Store has guitars on sale for $350, keyboards for $1200 and Melodicas
for $65. Write a program to produce the following sign on the screen:
Guitars 350 dollars
Keyboards 1200 dollars
Melodicas 65
dollars
6. Write a
program that draws the following face on the screen:
*****
* *
* ‑ ‑
*
* o
o *
*
| *
*
+ *
*
\ _ / *
* *
*****
7. Write a
program to produce these calculations (the computer does the math):
4 + 2 = 6
4 - 2 = 2
4 * 2 = 8
4 / 2 = 2.O