8000 TypeConversion example · dsabhrawal/python-examples@9b83874 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9b83874

Browse files
committed
TypeConversion example
1 parent 14d4a37 commit 9b83874

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

TypeConversion/TypeConversion.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,11 @@
1313
print(bool(x)) #print True
1414
print(bool(0)) #Print False
1515

16+
#str()
17+
print(str('10.5555'))
18+
print(str(x))
19+
20+
#complex()
21+
print(complex(2)) #prints (2+0j)
22+
print(complex(2,1)) #prints (2+1j)
23+
print(complex(x)) #prints (10.5+0j)

0 commit comments

Comments
 (0)
0