Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Complex(object):
- def __init__(self, re, im):
- self.re = re
- self.im = im
- def print(self):
- if(self.im >= 0):
- print(self.re , " + ",self.im , "i")
- else:
- print(self.re, " " ,self.im , "i")
- a = Complex(1,1)
- a.print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement