• Corsi
  • Compilatore di codice
  • Discuti
  • Prezzi
  • Squadre
Menu
+ 1

Round can't round the complex number, just need to round it ,how. ??

This is the code import cmath print(round(cmath.sqrt(12*32/5))) output: TypeError: type complex doesn't define __round__ method

python3
6th Jan 2018, 12:10 PM
RODENT
RODENT - avatar
2 Risposte
+ 9
Another example: https://stackoverflow.com/questions/25820322/how-to-round-up-a-complex-no1-9999999999999998-2j-as-2-2j-in-JUMP_LINK__&&__python__&&__JUMP_LINK
6th Jan 2018, 12:30 PM
jay
jay - avatar

Hai spesso domande come questa?

Impara in modo più efficiente, gratuitamente:

  • Introduzione a Python

    7,1M studenti

  • Introduzione a Java

    4,7M studenti

  • Introduzione a C

    1,5M studenti

  • Introduzione a HTML

    7,5M studenti

Vedi tutti i corsi
Popolare oggi
Issue with Sololearn Module Quiz Despite Correct Answers
1 Votes
Remove
0 Votes
I need help to solve this
0 Votes
Engineer Cloud
0 Votes
Project
0 Votes
Lua?
1 Votes
Hey what the research process order for them that I am telling you please order them and tell me answer
0 Votes
by getting subscription will it help to me be a pro in python is it appropriate app? please guide me
0 Votes
Ayuda para insertar la imagen de portada y las melodías a mi álbum alguien sabe cómo
0 Votes