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 cf5912f

Browse files
author
Rai Muhammad Haider
committed
dataTypes
1 parent 6c48a8e commit cf5912f

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

‎DataTypesAndInternalWorking.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# int, float , string , boolean , dictionary , list , nonetpye ,touple , set
2+
age = 21 # number
3+
print(type(age))
4+
total_amount = 99.99 # float
5+
print(type(total_amount)) # this will tell us typle of dataType
6+
name = 'Ali' # string
7+
print(type(name))
8+
is_acrive = False # boolean
9+
print(type(is_acrive))
10+
product = { # dictionary
11+
'tittle' : 'cosmatic product',
12+
'price' : 100,
13+
}
14+
print(type(product))
15+
probability_list = ['ali', True , 31] # for list
16+
print(type(probability_list))
17+
result = None #NoteType none mean empty
18+
print(type(result))
19+
points = (1,2,3,4) # tuple
20+
print(type(points))
21+
numbers = {1,2,3,4,6} # set
22+
print(type(numbers))
23+
24+
25+
print(len(name)) # this will tell us length
26+
l1 = [1,2,3,4]
27+
l2 = l1
28+
print(l2)
29+
l2[0] = 55
30+
print(l2)
31+
print(l1)
32+
# In Python, variables don’t store data directly, they store a reference (a pointer) to an object in memory.

0 commit comments

Comments
(0)

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