Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to create tuples in python?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 294
    Comment on it

    In python, tuples is just like a list but little differ form list, To say correctly tuples is a sequence of immutable Python objects and it can not be change just like a list also tuples use parentheses.
    Creating a tuple is as simple you have to just putt different comma-separated values. as show in example given below

    tup1 = (50, 60);
    tup2 = ('abc', 'pqr');
    tup3 = tup1 + tup2;
    print "here is tuple add two another two tuple ", tup3
    Output: (50, 60, 'abc', 'pqr)
    

 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: