Halloween Sale: Flat 70% + Addl. 25% Off + 30 Days Extra Lab on all Courses | Use Coupon HS25 in Checkout | Offer Expires In

  Enroll Now

Working with Tuples

We can access elements of the tuple using square brackets but we can't reassign the value because tuples are immutable. We can also slice the tuples to get multiple elements using the indices as the range.

t = (1,3,5,2,54,34,2,34,5)
l = len(t)
print(t[l-2])

Enter the result

t2 = t[2:5]

What will be the sum of elements present in t2?

t3 = t[1:3] + t2[:]

What will be the sum of elements present in t3?


No hints are availble for this assesment

Answer is not availble for this assesment


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...