Advertisement
OreganoHauch

human_class

Dec 31st, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. # class for a human function
  2. class Human:
  3.  
  4. #initialisation method with internal data
  5. def __init__(self, name, body_temp, age, residence):
  6. self.name = name;
  7. self.body_temp = body_temp
  8. self.age = age
  9. self.residence = residence;
  10. pass
  11.  
  12.  
  13. #get status
  14. def status(self):
  15. print("Human name is ", self.name, ".")
  16. print("Body temperature is ", self.body_temp)
  17. print("Age is ", self.age)
  18. print("Residence is at ", self.residence)
  19. pass
  20.  
  21. #set temperature
  22. def setTemperature(self, temp):
  23. self.temperature = temp
  24. pass
  25.  
  26. pass
  27.  
  28. jimmy = Human("Jimmy", 37, 23, "New York")
  29. jimmy.status()
  30.  
  31. jimmy.setTemperature(40)
  32. jimmy.status()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement