Class XI (As Per CBSE Board) : Computer Science
Class XI (As Per CBSE Board) : Computer Science
syllabus
2020-21
Chapter 13
Tuples
Computer Science
Class XI ( As per CBSE Board)
Visit : python.mykvs.in for regular updates
Tuples
Creating A Tuple
A tuple is enclosed in parentheses () for creation and each item is
separated by a comma.
e.g.
tup1 = (‘comp sc', ‘info practices', 2017, 2018)
tup2 = (5,11,22,44)
e.g.
tup1 = ("comp sc", "info practices", 2017, 2018)
tup2 = (5,11,22,44,9,66)
print ("tup1[0]: ", tup1[0])
print ("tup2[1:5]: ", tup2[1:5])
Output
('tup1[0]: ', 'comp sc')
('tup2[1:5]: ', (11, 22, 44, 9))
Visit : python.mykvs.in for regular updates
Tuples
Output
5
11
22
Output
(1, 2, 'a', 'b')
Output
(1, 3)
if (B==True):
print("Found")
else:
print("Not Found")
if(fr[i] != visited):
fr[i] = count;