diff --git a/stringformat.py b/stringformat.py new file mode 100644 index 00000000..4dd1e270 --- /dev/null +++ b/stringformat.py @@ -0,0 +1,5 @@ +import cmath +a=float(input('enter real part of complex number')) +b=float(input('enter imag part of complex number')) +c_sqrt=cmath.sqrt(complex(a,b)) +print('square root of {0:0.3f} + {1:0.3f}j is {2:0.3f} + {3:0.3f}j'.format(a,b,c_sqrt.real,c_sqrt.imag)) \ No newline at end of file