0% found this document useful (0 votes)
7 views1 page

Python 6

The document explains how to access the real and imaginary parts of a complex number in Python using the 'real' and 'imag' attributes. It also provides examples of the default values for single value data structures such as int, float, bool, and complex. Each data type returns its respective default value when instantiated without arguments.

Uploaded by

lnk313677
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Python 6

The document explains how to access the real and imaginary parts of a complex number in Python using the 'real' and 'imag' attributes. It also provides examples of the default values for single value data structures such as int, float, bool, and complex. Each data type returns its respective default value when instantiated without arguments.

Uploaded by

lnk313677
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Data structure

09 November 2025 11:55 AM

[Link] [gives real part]


[Link] [gives imag part]

>>>a=4+7j
>>>[Link]
4.0
>>>[Link]
7.0
In python the real and imaginary part will be
shown in float data type in complex.

The default value of Singel Value Data structure

>>>int()
0
>>>float()
0.0
>>>bool()
False
>>>complex()
0j

New Section 1 Page 1

You might also like