This is the code for part 1 and works. Now I need part 2. If you…
Question Answered step-by-step This is the code for part 1 and works. Now I need part 2. If you… This is the code for part 1 and works. Now I need part 2. If you can’t complete it please don’t answer it. If you can complete it please do so. Please don’t just put code that doesn’t answer the question and please submit the code that actually runs with format. import randomCOL = 13ROW = 16SPA = 75class Coin: def __init__(self,type): self.type = type self.content = True def getType(self): return self.type def __str__(self): c = str(self.type) + ‘C’ return cclass Grid: def __init__(self): self.coins = [] for i in range(COL): self.coins.append([]) for j in range(ROW): if j < SPA and random.randint(0,1) == 1: self.coins[i].append(Coin(1)) elif j < SPA and random.randint(0,1) == 1: self.coins[i].append(Coin(5)) else: self.coins[i].append(None) def __str__(self): for i in range(COL): for j in range(ROW): if self.coins[i][j] is None: print(" ", end = "") else: print(str(self.coins[i][j])+ " ", end = "") print() return "" def main(): grid = Grid() print(grid) main() Image transcription textPart 2: Finding discontent coins At this point, eachgrid that your program produces will be full ofseemingly content coins. Your Coin ob... Show more... Show more Part 1Image transcription textimport random COL = 13 ROW = 16 SPA = 75 class Coin: def init(self, type) : self . type = type self. content = True def getType (self): return self. type def str_(self) : return str (self.type) + ... Show more... Show more Computer Science Engineering & Technology Python Programming CS 0421 Share QuestionEmailCopy link Comments (0)


