-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTuples.py
More file actions
20 lines (16 loc) · 617 Bytes
/
Tuples.py
File metadata and controls
20 lines (16 loc) · 617 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#Tuples in python
'''
you can print tuples values.
but you cannot change anything in tuple.
tuples length is pre-defined which never can change
'''
#who you can know that it is tuple or not?
#it can store 4-data types but not like "List"=[]
#you store value as "(1,"yes",1.5,true)" let understand with example
t=("python",True,1,10.10)
print(t)#all values will print
#you can print single value also using slicing
print(t[2])#index number=2 item will print
#Can you chnage values in tuple like you don in "List"
#t[2]=5
#print(t) #now got an error because you read values from tuple but cannot chnage that value.