Question
Develop a Python program that uses while loop(s) to write a series of asterisks to the browser window. Part 1: 1. Use input and int
Develop a Python program that uses while loop(s) to write a series of asterisks to the browser window. Part 1: 1. Use input and int functions to get a maximum count value, from the user that is running the program. You can pick the variable name. 2. Create a second variable to hold an iteration count value. The iteration count variable will be incremented on each iteration through the loop. You can also select the name of this variable. 3. Assign the iteration count variable a starting value of 0. 4. Write a while statement that contains a condition (i.e. innerCount < maxCount) that will have the program continue iterating in the while loop as long as iteration count is less than the maximum count. 5. Make sure you increment the iteration count variable inside the while loop, or you may end up with an endless loop. 6. Inside the loop add a statement to print one asterisk and not break to the next line ( end='' ) 7. Run the program. You should see a single line of 10 asterisks. From here on down, the loop in Part 1 will be referenced as the Inner-Loop.
Part 2: 8. Build a second while loop to execute the loop (Inner-Loop) that you completed in Part 1. This new loop is the Outer-Loop. You can use the same variable you created above for the maximum count variable. 9. You will need another loop iteration count variable. Set the new loop iteration variable to 0. 10. Inside the Outer-Loop add the statement: print() This will cause a break (movement to the next line) each time through the Outer-Loop. 11. Make sure you increment the new iteration count variable (the one created in step 9) inside the OuterLoop while loop, or you may end up with an endless loop. 12. Run the program. If you enter 10, you should see 10 lines with 10 asterisks on each line.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started