Advertisement
Guest User

Untitled

a guest
Jan 5th, 2019
24,665
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.89 KB | None | 0 0
  1. from __future__ import print_function
  2.  
  3. class TaiwanConsensusBuilder:
  4.     def __init__(self):
  5.         self._subject = ''
  6.         self._oppose = ''
  7.         self._motto = ''
  8.  
  9.     def will(self):
  10.         self._oppose = 'one country, two systems'
  11.         return self
  12.  
  13.     def always(self):
  14.         self._subject = 'The vast majority of Taiwanese'
  15.         return self
  16.  
  17.     def believe(self):
  18.         self._motto = 'Taiwan consensus'
  19.         return self
  20.  
  21.     def __str__(self):
  22.         return ('Taiwan abosolutely will not accept "{0}".\n\r' +
  23.                 '{1} resolutely oppose "{0}".\n\r' +
  24.                 'This is the "{2}".').format(self._oppose,
  25.                                              self._subject,
  26.                                              self._motto)
  27. if __name__ == '__main__':
  28.     taiwan = TaiwanConsensusBuilder()
  29.  
  30.     print(taiwan.will().always().believe())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement