Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. class Person:
  2.     def __init__(self, name, lastname):
  3.         self.name = name
  4.         self.lastname = lastname
  5.  
  6.     def show_name(self):
  7.         print("My name is " + str(self.name))
  8.  
  9.     def show_lastname(self):
  10.         print("My lastname is " + str(self.lastname))
  11.  
  12.  
  13. obj = Person("Karter","Bishop")
  14. obj.show_name()
  15. obj.show_lastname()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement