Advertisement
RadioNurshat

Complex

May 26th, 2021
1,081
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. class Complex(object):
  2.     def __init__(self, re, im):
  3.         self.re = re
  4.         self.im = im
  5.    
  6.     def print(self):
  7.         if(self.im >= 0):
  8.             print(self.re , " + ",self.im , "i")
  9.         else:
  10.             print(self.re, " " ,self.im , "i")
  11.            
  12. a = Complex(1,1)
  13. a.print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement