Question: python is used 2. Write a function print_shape that take any positive inter ipot, and that prints an n x n grid of numbers according
2. Write a function print_shape that take any positive inter ipot, and that prints an n x n grid of numbers according to the pattern shown below. print_shape (4) 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 print shape(5) 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 3. Write a function powers that takes any positive integer n as input, and that prints all of the powers of 3 less than or equal to n. For example, powers 3 (1000) should print the numbers 1, 3, 9, 27, 81, 243, and 729. (Note that the next power of 3, which is 2187, should not be printed in this case, since it is greater than the input of 1000.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
