A class definition called Property is given below. Create code for a method that displays a brief description of the property when the Python print function prints the object id of the property. The “__size” and “__value” attributes are integer values, the other attributes are strings. class Property ( ): def __init__(self, name, propID, loc, size, value, owner): self.__name = name self.__propID = propID self.__loc = loc self.__size = size self.__value = value self.__owner = ownerFor example, when this code is executed: p1 = Property(‘Private Res.’, ‘FX0042’, ‘9900 University Dr’, 9500, 765000, ‘Maria Muellerl’) ……the code print(p1) displays this: Name: Private Res. Property ID: FX0042 Location: 9900 University Dr Size: 9500 sq ft Value: $765000 Owner: Maria Mueller
Write the complete display output of the following two lines…
Write the complete display output of the following two lines of code if the code that follows the two lines is first executed. m1.chgEmail(‘jbuffet@margaritaville.com’)print(e2.name, ‘\n’, w1.email, ‘\n’, str(m1.salary)) class Employee (object): def __init__(self, name, email): self.name = name self.email = email def chgEmail (self, newEmail): self.email = newEmail + ‘.com’ return True class Manager (Employee): def __init__(self, name, email, salary): super().__init__(name, email) self.salary = salary def chgEmail(self, newEmail): self.email = newEmail class Worker (Employee): def __init__(self, name, email, hourly): super().__init__(name, email) self.hourly = hourly # executable code that follows the code above:e1 = Employee (‘John Davis’, ‘jDavis@gmail.com’)e2 = Employee (‘James Bradley J’, ‘jbjones@psu.edu’)w1 = Worker (‘Karina Walden’, ‘kwalden@state.gov’, 18.50)w2 = Worker (‘Juan MacMaster’, ‘jmacmaster@gmail.com’, ‘17.25’)m1 = Manager (‘Warren Buffet’, ‘wbuffet@bhathaway.com’, 92000)m2 = Manager (‘Erica Contreras’, ‘econtreras@gmail.com’, 110000)
An example of an Application Program Interface (API) was pre…
An example of an Application Program Interface (API) was presented in class during week #13. Which of the following are true about that API? Check all that are true.
This and the next two questions pertains to writing Python c…
This and the next two questions pertains to writing Python code to help process and analyze NFL Superbowl data. Given a text file whose name is ‘superbowl.txt’ that has the following data (as seen when you open it with Notepad): I,1967,Green Bay, 35, Kansas City, 10II,1968,Green Bay,33,Oakland, 14III,1969,New York Jets, 16, Baltimore, 7 . . . . LVII,2023,Kansas City, 38, Philadelphia, 35LVIII,2024,Kansas City, 25, San Francisco, 22LIX,2025,Philadelphia, 40, Kansas City,22 The file contains data on all 59 Superbowls, including: the number (I, II, III, …), year, winning team, winner’s score, losing team, and loser’s score. Write Python code to create a class called NFL that’s a subclass of the list class. Include a method called load() that will open the file, read the file’s contents using readlines(), convert each line of data into a sublist, clean the data, and store it in self. The structure of self will look like the following: , , , . . . . , , ]
What lines will appear in the display output of the followin…
What lines will appear in the display output of the following code? Check all that apply.class OnlyEvens (Exception): passtry: num = 58 if int(num) % 2 != 0: raise OnlyEvens (“Only even integers allowed”) print(‘Number is even’) print(‘Exiting’)except Exception as e: print(‘Something went wrong’)finally: print (‘Finito’)
The concept “homogamy” means that ________.
The concept “homogamy” means that ________.
Assume you were visiting a society in which people traced fa…
Assume you were visiting a society in which people traced family ties only through women. This society would correctly be called ________.
The concept “patrilocality” refers to ________.
The concept “patrilocality” refers to ________.
An interface reference can refer to any object of any class…
An interface reference can refer to any object of any class that implements the interface.
Which of the following methods will sort an array of floats…
Which of the following methods will sort an array of floats in ascending order?