+ 4

Hey , I have a question Guys !

Let say if we open IDLE and write ; a= 3.14 Id(3.14) Id(a) Address is Different for float Values (how and why?)and b= 3 Id(3) Id(b) Same address ( How and why ? )

29th Apr 2019, 3:08 AM
Gourav Singh
Gourav Singh - avatar
1 Odpowiedź
0
This shows the unique identifier of an object, therefore each object with different value have different identifier. Since 3 and 3.14 are two completely different numbers they have completely different indentity numbers. You can find more info in the Python documentation
28th Oct 2022, 10:34 PM
Devnull
Devnull - avatar