subject

In this code, there's a Person class that has an attribute name, which gets set when constructing the object. Fill in the blanks so that 1) when an instance of the class is created, the attribute gets set correctly, and 2) when the greeting() method is called, the greeting states the assigned name. mtino 1-class Person: 2 - def __init__(self, name): self. name = def greeting(self): # Should return "hi, my name is " followed by the name of the Person. return Run 8 # Create a new instance with a name of your choice 9 some_person = 10 # Call the greeting method 11 print (some_person. ) 12 Press ESC to exit the code block at any time

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:40
Microsoft introduced active directory with windows 2000. in server 2012, it is in now version 4. what are some new features in the new ad that were not present in windows 2000 ad?
Answers: 1
question
Computers and Technology, 22.06.2019 14:00
Which database model is best used for data warehouse and data mining
Answers: 3
question
Computers and Technology, 22.06.2019 15:20
This os integrated the processing power of windows nt with the easy-to-use gui of windows 98. windows 2000 windows 3.11 windows for workgroups windowa millennium edition
Answers: 1
question
Computers and Technology, 22.06.2019 19:50
Write a car class having two private member variables called tank and speed. write public methods called pumpgas and gofast. the method pumpgas gets an integer for gas that must be pumped. that value needs to be added to tank (no more than 20 gallons). it must return the amount of gas that is purchased ($4 per gallon). the method gofast should increase the speed by 5 each time it is called.write a constructor for the above class that initialized both variables to zero.write a tostring to display both the tank and speed when the car is printed.modify the car class to implement the interface comparable and an interface called carinter having the public methods in carinter.write the main program to create an array of size 5 of type car. create 5 car objects having each location of the array to refer to one of the cars. test the pumpgas, gofast, equals method on the array items. write an enhanced loop to print all the car values (using a tostring written last time).write a generic method to find the minimum of four items. pass int, double, char, string and car objects to test this method.
Answers: 1
You know the right answer?
In this code, there's a Person class that has an attribute name, which gets set when constructing th...
Questions
question
Mathematics, 18.10.2020 15:01
question
Mathematics, 18.10.2020 15:01
question
Biology, 18.10.2020 15:01
question
Social Studies, 18.10.2020 15:01
Questions on the website: 13722360