I need help creating a Python program to set up 2 right-angle triangles of asterisks (one right side up, followed by the second one as an upside-down triangle, right underneath the first triangle). The following is an example: With 3 as the input data, here's the pattern: * ** *** ** * Input Data: An integer between 1 to 50 Set up an input validation loop to ensure the entered data is within range As long as the entered data is not within range, the user is to be prompted repeatedly until the entered data is within range; at that point, then the valid input data is to be used to set up the pattern Sample interactions: Enter an integer between 1 to 50 (message from program) -9 (entered by user) -9 is not between 1 to 50; enter an integer between 1 to 50 (message from program) 51 (entered by user) 51 is not between 1 to 50; enter an integer between 1 to 50 (message from program) . . . (additional incorrect input data and program's response) 5 (entered by user as a valid input data) for example output below: With 5 as the input data, here's the pattern: * ** *** **** ***** **** *** ** *
I need help creating a Python
The following is an example:
With 3 as the input data, here's the pattern:
*
**
***
**
*
Input Data:
- An integer between 1 to 50
- Set up an input validation loop to ensure the entered data is within range
- As long as the entered data is not within range, the user is to be prompted repeatedly until the entered data is within range; at that point, then the valid input data is to be used to set up the pattern
- Sample interactions:
Enter an integer between 1 to 50 (message from program)
-9 (entered by user)
-9 is not between 1 to 50; enter an integer between 1 to 50 (message from program)
51 (entered by user)
51 is not between 1 to 50; enter an integer between 1 to 50 (message from program)
. . . (additional incorrect input data and program's response)
5 (entered by user as a valid input data)
for example output below:
With 5 as the input data, here's the pattern:
*
**
***
****
*****
****
***
**
*
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images