Reference no: EM131268732
Plan each program by writing pseudocode.
Write all lines of your pseudocode as comments immediately.
Add more comments in each program to explain what your code is doing.
Choose descriptive variable names in all programs.
1. Write a program called program41.py that uses a for loop and the range functionto output the numbers from 5 up to 100 by fives exactly as shown (all numbers all on the same line, separated by a single space). Output "That's that!" (note apostrophe) on a new line to end the program as shown below.
SAMPLE RUN
5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100
2. Write another program called program42.py that generates exactly the same output as the program above, but by using a while loop.
3. Write a program named program43.py that uses nested loops to generate a triangle as shown in the sample run. The program should begin by prompting the user to enter the number of lines in the triangle.
4. Write a program named program44.py that can be used to determine the average of some integers. The number of integers can vary, and this should not be initially set by user input (see sample output). Instead, use a while loop and a sentinel value of zero to cease integer input. Display the average accurate to two decimal places.
SAMPLE RUN
Enter integer 12
Enter integer 9
Enter integer 8
Enter integer 14
Enter integer 0
The average is 10.75