Question: Problem 1 . Display an n by n asterisks For this problem, you need to complete the following tasks. Prompt the user for a positive

Problem 1. Display an n by n asterisks
For this problem, you need to complete the following tasks.
Prompt the user for a positive integer n.
If the user enters a positive integer for n, then write a for loop to display n rows of the numbers 1 through n(but counting down) separated by a space in each row;
if n is not positive, display the message "Invalid Input" and ask the user to type 'y' or 'Y' if they wish to 'Try Again.' Use a while True loop to check their input and return back to the top of the while True loop if they answer yes.
Test your program by entering different values of n.
Below is a sample output:
Enter a positive integer: 6
6,5,4,3,2,1
6,5,4,3,2,1
6,5,4,3,2,1
6,5,4,3,2,1
6,5,4,3,2,1
6,5,4,3,2,1
Problem 1 . Display an n by n asterisks For this

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!