Skip to content

Commit 66b9b1a

Browse files
authored
Create 6 Tuples().py
1 parent 2272632 commit 66b9b1a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

6 Tuples().py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#tuples - must use ()
2+
names = ('maniraj', 'hari', 'kathir', 'maniraj')
3+
# can't change values
4+
# sorting is also not working
5+
print(names)
6+
7+
#call particular value in tuples
8+
print(names[0])
9+
10+
11+
#slicing
12+
print(names[0:2])
13+
14+
# negative slicing
15+
print(names[-4:-2])
16+
print(names[-4:-1])
17+
18+
# length
19+
print(len(names))
20+
21+
# methods
22+
print(names)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy