Advertisement
Straevaras

Hello World by class

Apr 13th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. class HelloWorld:
  2.     def __init__(self):
  3.         self.first = "Hello"
  4.         self.last = "World"
  5.  
  6.     def __str__(self):
  7.         return ' '.join([self.first, self.last])
  8.  
  9. def main():
  10.     hw = HelloWorld()
  11.     print hw
  12.  
  13. if __name__ == "__main__":
  14.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement