Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dc4e7cc

Browse files
author
Rai Muhammad Haider
committed
typecasting
1 parent e2779ab commit dc4e7cc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎MuteableIMmuteable.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,18 @@
4444
x = 15 # here we have new one value now the new reference
4545
print(x)
4646
print(y) # but the y still have the old reference
47+
48+
# typecasting #############################
49+
son_name = 'Husnain Bro'
50+
age = 21
51+
married = True
52+
gpa = 3.5
53+
married = int(married)
54+
print(married) # converted into interger which is 1
55+
son_name = bool(son_name)
56+
print(son_name) # string into boolen true
57+
age = float(age)
58+
print(age) # converted into float
59+
married = str(married)
60+
print(married)
61+
print(type(married)) # string

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /