subject

The following block of code is used in each part of the exercise. It is repeated for readability. 1| class Dog: 2| def __init__(self, name = "", owner = None): 3| self. name = name 4| self. owner = owner 5| def speak(self): 6| print("WOOF!") 7| 8| class Owner: 9| def __init__(self, name): 10| self. name = name 11| def speak(self): 12| print("My name is:", name) Imagine that we have applied the fix from Part 3 to this code. Then, imagine that after that class definition, we wrote the following code: 14| owner1 = Owner("David") 15| owner2 = Owner("Priyank") 16| dog1 = Dog("Fido", owner1) 17| dog2 = Dog("Barkley", owner2) 18| dog3 = Dog("Spot", owner2) 19| dog4 = Dog() 20| newList = [owner1, dog1, owner2, dog2, dog3, dog4] 21| for item in newList: 22| print(item. speak()) What would this code print?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:00
Match the following. 1. show grouping of word processing tasks that can be performed quick access toolbar 2. shortcut location for commonly used elements scroll bars 3. organized commands used to modify documents ribbon 4. used to align and measure content in a word screen zoom bar 5. vertical and horizontal bars that are used to navigate through a document contextual tabs 6. displays the name of the document in use ruler 7. allows users to enlarge or shrink a visual of a word document title bar
Answers: 2
question
Computers and Technology, 23.06.2019 14:00
In which job role will you be creating e-papers, newsletters and preiodicals
Answers: 1
question
Computers and Technology, 24.06.2019 00:00
The gene form of a trait is called a(n) 
Answers: 2
question
Computers and Technology, 24.06.2019 02:20
The first time a user launches the powerpoint program, which view is shown allowing the user to access recent presentations or create new presentations based on templates?
Answers: 1
You know the right answer?
The following block of code is used in each part of the exercise. It is repeated for readability. 1|...
Questions
question
Mathematics, 16.12.2020 18:30
question
Mathematics, 16.12.2020 18:30
question
Mathematics, 16.12.2020 18:30
question
World Languages, 16.12.2020 18:30
question
Mathematics, 16.12.2020 18:30
question
English, 16.12.2020 18:30
Questions on the website: 13722363