program4_1.py

Write a program that uses a for loop and the range function to process all integers from 999 down to zero. Code in the loop should print multiples of 40 on one line separated by spaces, but with only six per line. See Required Output. Use a counter to determine when six multiples have been printed.

Required Output

960 920 880 840 800 760
720 680 640 600 560 520
480 440 400 360 320 280
240 200 160 120 80 40

Program4_2.py

Write a program that uses a while loop to examine every integer from 999 down to zero and generate the exact same output as shown in program4_2 above. The range function is not required. NOTE: you must use a while loop.

Program4_3.py

Write a program that uses nested loops to print a "Multiplication Matrix" as shown below. Use the format function to output columns 4 characters wide (see page 72-73). NOTE: You must use nested loops.

Multiplication Matrix
1 2 3 4 5 6 7 8 9
2 4 6 8 10 12 14 16 18
3 6 9 12 15 18 21 24 27
4 8 12 16 20 24 28 32 36
5 10 15 20 25 30 35 40 45
6 12 18 24 30 36 42 48 54
7 14 21 28 35 42 49 56 63
8 16 24 32 40 48 56 64 72
9 18 27 36 45 54 63 72 81

Program4_4.py

Study this turtle graphic for a moment. Note where drawing starts and ends. Now create this graphic pattern with Python by using the turtle module, a for loop, and the range function. see image.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.