We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Classes: Dealing with Complex Numbers
Classes: Dealing with Complex Numbers
Sort by
recency
|
261 Discussions
|
Please Login in order to post a comment
Here is HackerRank Classes: Dealing with Complex Numbers in Python solution - https://programmingoneonone.com/hackerrank-classes-dealing-with-complex-numbers-solution-in-python.html
i haven't coppied and pase no
import math
class Complex(object):
if name == 'main': c = map(float, input().split()) d = map(float, input().split()) x = Complex(*c) y = Complex(*d) print(*map(str, [x+y, x-y, x*y, x/y, x.mod(), y.mod()]), sep='\n')
import math
class Complex(object):
if name == 'main': c = map(float, input().split()) d = map(float, input().split()) x = Complex(*c) y = Complex(*d) print(*map(str, [x+y, x-y, x*y, x/y, x.mod(), y.mod()]), sep='\n')