( , tuple containing an integer as special casepython also allows you to omit the opening and closing parentheses for tuple in contexts where it isn' syntactically ambiguous to do so for instancethe fourth line of table - simply lists four items separated by commas in the context of an assignment statementpython recognizes this as tupleeven though it doesn' have parentheses nowsome people will tell you to always use parentheses in your tuplesand some will tell you to never use parentheses in tuples (and still others have livesand won' tell you what to do with your tuples!the most common places where the parentheses are required for tuple literals are those whereparentheses matter--within function callor nested in larger expression commas matter--embedded in the literal of larger data structure like list or dictionaryor listed in python print statement in most other contextsthe enclosing parentheses are optional for beginnersthe best advice is that it' probably easier to use the parentheses than it is to remember when they are optional or required many programmers (myself includedalso find that parentheses tend to aid script readability by making the tuples more explicit and obviousbut your mileage may vary conversionsmethodsand immutability apart from literal syntax differencestuple operations (the middle rows in table - are identical to string and list operations the only differences worth noting are that the +*and slicing operations return new tuples when applied to tuplesand that tuples don' provide the same methods you saw for stringslistsand dictionaries if you want to sort tuplefor exampleyou'll usually have to either first convert it to list to gain access to sorting method call and make it mutable objector use the newer sorted built-in that accepts any sequence object (and other iterables-- term introduced in that we'll be more formal about in the next part of this book) ('cc''aa''dd''bb'tmp list(ttmp sort(tmp ['aa''bb''cc''dd' tuple(tmpt ('aa''bb''cc''dd'sorted( ['aa''bb''cc''dd' tuplesfilesand everything else make list from tuple' items sort the list make tuple from the list' items or use the sorted built-inand save two steps