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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started