Implicit type conversion: Difference between revisions
Content added Content deleted
Ectomancer (talk | contribs) m (→alternative) |
Ectomancer (talk | contribs) m (→alternative) |
||
Line 1,496: | Line 1,496: | ||
===alternative=== |
===alternative=== |
||
One case of implicit casting and one quasi-case: |
One case of implicit casting and one quasi-case: |
||
<syntaxhighlight lang="python">>>> 12/3 # Implicit cast from int to float. |
<syntaxhighlight lang="python">>>> 12/3 # Implicit cast from int to float, by / operator. |
||
4.0 |
4.0 |
||
>>> (2+4j)/2 # But no implicit cast for complex parts. |
>>> (2+4j)/2 # But no implicit cast for complex parts. |