(Solved) : Numbers Pattern Using Nested Loops Implement Following Functions Print Numbers Pattern Pri Q41401539 . . .

Python 3: Please follow the respective rubricfor the following function definition.

Numbers in a Pattern (Using Nested Loops) You should implement the following functions to print numbers in a pattern. • print

Rubric:

[3 points) Prints the rectangle: • Asks correctly for the values allowed. • If the value is incorrect it keeps looping and sh

Numbers in a Pattern (Using Nested Loops) You should implement the following functions to print numbers in a pattern. • print_power_pattern(num1, num2, ascending). This function will print a upper-triangle matrix-like layout filled will a sequence of integers. The integers will be between num1 and num2 inclusive raised to a different power at each row depending on the value of ascending. For example, assume there are five integers between num1 and num2. The pattern will contain 5 rows. If ascending is True, row one will raise each integer to power 1, row two to power 2, etc. and if ascending is False, row one will raise each integer to power 5, row two to power 4, etc. Each subsequent row will contain the postfix of the previous row. For example, the call print_power_pattern(3, 9, True) should print the following pattern. . 16 25 125 216 1296 343 2401 16807 512 4096 32768 262144 81 729 6561 59049 531441 4782969 and the call print_power_pattern(3, 9, False) will print the following pattern 4782969 2187 ل 2097152 262144 823543 117649 16807 279936 46656 7776 1296 78125 15625 3125 16384 4096 1024 256 ه لما ت 125 له ما لا Here, each value is formatted in right-adjusted 12 digits. This function must not interact with the user and must use nested for-loops to print the pattern. • make_pattern(). This function will prompt the user for entering the num1, num2, and ascending variables, and call the print_power_pattern() function to print the pattern once the user input has been validated to satisfy the following requirements. 0 <= numl < 10 0 <= num2 < 10 [3 points) Prints the rectangle: • Asks correctly for the values allowed. • If the value is incorrect it keeps looping and shows the indications again. Prints the rectangle with the size selected by the user. • It uses the three functions to print the rectangle as specified above. [4 points] Prints the triangle: • Asks correctly for the values allowed. • If the value is incorrect it keeps looping and shows the indications again. Pay attention that here it has to be an even number between 1 and 80. • Prints triangle with the size selected by the user using nested loops. [4 points] Prints the diamond: • Asks correctly for the values allowed. • If the value is incorrect it keeps looping and shows the indications again. Pay attention that here it has to be an even number between 1 and 80. • Prints the diamond with the size selected by the user using the different function calls. • The program asks and prints the different values to output outside and inside the contour of the program. [5 points] Prints the pattern: • Asks correctly for the values allowed. • If the values are incorrect it keeps looping and shows the indications again. Pay attention that here it has to be any integer value between 0 and 9. • Asks the user if the numbers will be printed in ascending or descending order and loop until a valid value is input. • Prints the pattern with the numbers the user inputs and the correct powers with appropriate formatting . Show transcribed image text Numbers in a Pattern (Using Nested Loops) You should implement the following functions to print numbers in a pattern. • print_power_pattern(num1, num2, ascending). This function will print a upper-triangle matrix-like layout filled will a sequence of integers. The integers will be between num1 and num2 inclusive raised to a different power at each row depending on the value of ascending. For example, assume there are five integers between num1 and num2. The pattern will contain 5 rows. If ascending is True, row one will raise each integer to power 1, row two to power 2, etc. and if ascending is False, row one will raise each integer to power 5, row two to power 4, etc. Each subsequent row will contain the postfix of the previous row. For example, the call print_power_pattern(3, 9, True) should print the following pattern. . 16 25 125 216 1296 343 2401 16807 512 4096 32768 262144 81 729 6561 59049 531441 4782969 and the call print_power_pattern(3, 9, False) will print the following pattern 4782969 2187 ل 2097152 262144 823543 117649 16807 279936 46656 7776 1296 78125 15625 3125 16384 4096 1024 256 ه لما ت 125 له ما لا Here, each value is formatted in right-adjusted 12 digits. This function must not interact with the user and must use nested for-loops to print the pattern. • make_pattern(). This function will prompt the user for entering the num1, num2, and ascending variables, and call the print_power_pattern() function to print the pattern once the user input has been validated to satisfy the following requirements. 0

Expert Answer


Answer to Numbers in a Pattern (Using Nested Loops) You should implement the following functions to print numbers in a pattern. �…