Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Candidate:
- def __init__(self, name, website, twitter):
- self.name = name
- self.website = website
- self.twitter = twitter
- def SayHello(self):
- print("Hello, I'm " + self.name)
- print("Please visit my website: " + self.website)
- print("Or find me on twitter at: " + self.twitter)
- def SetName(self, name):
- self.name = name
- if __name__ == "__main__":
- hillary = {'name':'Hillary Clinton',
- 'website':'http://hillaryclinton.com',
- 'twitter':'http://twitter.com/HillaryClinton'}
- print(hillary['name'])
- print(hillary['website'])
- print(hillary['twitter'])
- bernie= Candidate("Bernie Sanders",
- "http://berniesanders.com",
- "http://twitter.com/BernieSanders")
- bernie.SayHello()
Advertisement
Add Comment
Please, Sign In to add comment