[Tutor] appending to a list

David Bear david.bear at asu.edu
Thu Jan 31 05:17:50 CET 2008

I want to return a tuple from a function. I want to append the second
element of that tupple to a list. For example

mylist = []
def somefunc():
   return(3.14, 'some string')

somenum, mylist.append(??) somefunc()

obviously, the syntax doesn't work. This should be easy, but I've never seen
example code. any pointers?

David Bear
College of Public Programs at Arizona State University

More information about the Tutor mailing list