Use abs(z) to get its magnitude (as a float) or z.real to get its real part.,magnitudez.real,#The convers
Use abs(z) to get its magnitude (as a float) or z.real to get its real part.,magnitudez.real,#The convers
#The conversion functions to floating point and integer #(float(), int() and long()) don't work for complex numbers a=3.0+4.0jprint a.realprint a.imagprint abs(a) # sqrt(a.real**2 + a.imag**2)
相关内容
- Use function: oct, hex,octhex,print oct(64
- Adding 1 to maxint,addingtomaxint,from sys imp
- Sets: A set is an unordered collection with no duplicate elements,u
- set intersection,intersection,import setsm
- Reading from a Database,readingdatabase,import MySQL
- Use Pickle to save and read,picklesave,import pickl
- Find a word in shelve file,findshelve,import sys,
- hex literals,literals,print 0x01,
- Reading a binary File,readingbinaryfile,f = open('/m
- Slicing works similar to strings; use the square bracket slice operat
评论关闭