Mega Code Archive

 
Categories / Python Tutorial / Tuple
 

List() and tuple()

aList = ['tao', 93, 99, 'time'] aTuple = tuple(aList) print aList, aTuple aList == aTuple anotherList = list(aTuple) aList == anotherList print aList is anotherList print [id(x) for x in aList, aTuple, anotherList]