Question: ( Python problem ) 9 . 2 . 2 Classes: Grouping data Create an instance of the BookInfo class called new _ book. Then, assign
Python problem Classes: Grouping data
Create an instance of the BookInfo class called newbook. Then, assign newbook's attributes numpages and yearpublished
with the two values read from input, respectively.
Click here for example
Ex: If the input is:
then the output is:
Book info: pages, published in
class BookInfo:
def self:
self.numpages
self.yearpublished
pagesin intinput
publishedin intinput
Your code goes here
printBook info: end
printfnewbook.numpages pages, end
printfpublished in newbook.yearpublished
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
