Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Slicing of Tuple in python

# Slicing of a Tuple
 
# Slicing of a Tuple
# with Numbers
Tuple1 = tuple('Softhunt')
 
# Removing First element
print("Removal of First Element: ")
print(Tuple1[1:])
 
# Reversing the Tuple
print("
Tuple after sequence of Element is reversed: ")
print(Tuple1[::-1])
 
# Printing elements of a Range
print("
Printing elements between Range 4-9: ")
print(Tuple1[4:9])
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Slicing #Tuple #python
ADD COMMENT
Topic
Name
6+7 =