Question: In Python, lets practice OOP. Create a class called Picture with a class level attribute called LargestPossible_Size , which should be set to 8000. Note,

In Python, lets practice OOP.

Create a class called Picture with a class level attribute called LargestPossible_Size, which should be set to 8000.

Note, during instantiation the Picture class should take in two arguments as integers called length and width, that represents how many pixels the picture has; both will later be placed on instance.

Lets say each pixel takes 8 memory units. So, also create a function called calc_size and a functional attribute to fetch the size. This function gets the total memory units taken by the picture

If a picture has a size bigger than the LargestPossible_Size, a ValueError should be raised.

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!