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 66b9b1a

Browse files
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)

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