diff --git a/python-temel/print.example.2.py b/python-temel/print.example.2.py new file mode 100644 index 0000000..2bc4f44 --- /dev/null +++ b/python-temel/print.example.2.py @@ -0,0 +1,10 @@ +class Complex: + def __init__(self, real, imag): + self.real = real + self.imag = imag + + def __str__(self): + return '{}+{}i'.format(self.real, self.imag) + +z = Complex(3, 2) +print(z)