Advertisement
Fhernd

operaciones-complejos.py

May 24th, 2018
2,399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. import cmath
  2.  
  3. numero1 = complex(2, 4)
  4. numero2 = 3 - 5j
  5.  
  6. print(numero1)
  7. print(numero2)
  8.  
  9. print(numero1.real)
  10. print(numero2.imag)
  11.  
  12. print(numero1.conjugate())
  13.  
  14. print(numero1 + numero2)
  15. print(numero1 * numero2)
  16. print(numero1 / numero2)
  17. print(abs(numero1))
  18.  
  19. print(cmath.sin(numero1))
  20. print(cmath.cos(numero1))
  21. print(cmath.exp(numero1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement