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.
Enter your code here. Read input from STDIN. Print output to STDOUT
import cmath
complejo = complex(input())
print(complejo)
con .real se obtiene la parte real y con .img se obtiene la parte imaginaria
print(complejo.real, complejo.imag)
imprime The modulus (absolute value) of a complex number x can be computed using the built-in abs() function. There is no separate cmath module function for this operation
print(abs(complex(complejo.real, complejo.imag)))
imprimir la fase con complex para llamar el numero complejo bien
Polar Coordinates
You are viewing a single comment's thread. Return to all comments →
Enter your code here. Read input from STDIN. Print output to STDOUT
import cmath
complejo = complex(input())
print(complejo)
con .real se obtiene la parte real y con .img se obtiene la parte imaginaria
print(complejo.real, complejo.imag)
imprime The modulus (absolute value) of a complex number x can be computed using the built-in abs() function. There is no separate cmath module function for this operation
print(abs(complex(complejo.real, complejo.imag)))
imprimir la fase con complex para llamar el numero complejo bien
print(cmath.phase(complex(complejo.real, complejo.imag)))