Question: 1.Create from the list below a 5x5 sized 2D list full of zeroes in Python import matplotlib.pyplot as plt import myLib def initList(colSize,rowSize): # 2nd

1.Create from the list below a 5x5 sized 2D list full of zeroes in Python

import matplotlib.pyplot as plt

import myLib

def initList(colSize,rowSize): # 2nd and 3rd arguments are starting location of mouse in maze of size 8x8 # starting cell is (x,y) return [[0]*colSize for x in xrange(rowSize)] #return [[0]*colSize]*rowSize

def printList(list1,colSize,rowSize): for i in range(0,rowSize): for j in range(0,colSize): print list1[i][j], # the comma (,) does not print a newline print ' '

def scatter(list1,list2,opt1,opt2,opt3): plt.plot(list1,list2,opt1) plt.xlabel(opt2) plt.ylabel(opt3) plt.show() #Example use #sampleList = initList(4,7) #printList(sampleList,4,7)

'''or imported as library

import hwFunctions

sampleList = hwFunctions.initList(4,7) hwFunctions.printList(sampleList,4,7) '''

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!