Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Python Tuples

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 498
    Comment on it

    A tuple is a sequence of immutable Python objects. Tuples are in form of sequences as same as lists. The main differences between tuples and lists is that tuples cannot be changed like lists, also tuples use parentheses whereas lists use square brackets.
    For example you can see below code.

    tup1 = ('physics', 'chemistry', 1997, 2000);
    tup2 = (1, 2, 3, 4, 5 );
    tup3 = "a", "b", "c", "d";

    Output will be

    tup1 = (50,);

    Note-Like string indices, tuple indices start at 0, and they can be sliced, concatenated, and so on.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: