Question: import math import random import string import collections import datetime import re import time import copy # YOUR CODE BELOW... def writeVertical(n) : # your

import math import random import string import collections import datetime import re import time import copy # YOUR CODE BELOW...  def writeVertical(n) : # your code here... # end def def digitalSum(n) : # your code here... # end def def exponents(a, b) : # your code here... # end def def invertedImage(top, bottom, n) : # your code here... # end def  def main( ) : writeVertical(98312) print(===) writeVertical(0) print(===) writeVertical(-123456789) print(===) digitalSum(1234) print(===) exponents(3, -4) print(===) exponents(16, 0) print(===) exponents(0, 9) print(===) exponents(-18, 7) print(===) exponents(12, 12) invertedImage('*', '#', 6) print(===) invertedImage('@', '^', 18) # end main( ) if __name__ == "__main__" : main( ) 

Write a Python recursive function called 'invertedImage' that accepts 2 characters and an integer 'n' representing rows. This function displays an image of 'n' number of rows of the top character starting with n characters and proceeding to 1 character with each row indented using 0 spaces, then n + 1, etc. After the image using the top character is displayed, another image using the bottom character is displayed starting with 1 character and proceeding to n characters with each row indented using n - 1 spaces, then n - 2, etc. You may assume that the rows will be a positive number greater than 1. For example, invertedImage('*', '#', 6) will display: ****** ***** **** *** ** * # ## ### #### ##### ###### For example, invertedImage('?', '8', 4) will display: ???? ??? ?? ? 8 88 888 8888 The function prototype MUST be: def invertedImage(top, bottom, n) :

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 Databases Questions!