This question assesses your understanding of passing objects…
This question assesses your understanding of passing objects into functions and running a class method. What will be the output from the code below? (Please pay close attention to the calculations.) class VideoGame: def __init__(self, name, price): self.name = name self.price = price def update_price(self, discount): self.price = self.price * (1 – discount)def apply_discount(game, discount): game.price = game.price – discountgame1 = VideoGame(“The Last Adventure”, 60)apply_discount(game1, 10)game1.update_price(0.5)print(game1.price)
Read Details