Share
Finding element from tuple
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
How will you find the third through sixth elements from the tuple below (using a single line of code) ?
my_tuple=(10, 20, 30, 40, 50, 60, 80, 100)
Answers ( 3 )
You just need a single line of code to do this->
print(my_tuple[3:7])
# Printing 3rd to 6th element
print(my_tuple[2:6]);
my_tuple[2:6]