[Tutor] list semantics

Jim Mooney cybervigilante at gmail.com
Sat Apr 11 19:41:28 CEST 2015


Why does the first range convert to a list, but not the second?

>>> p = list(range(1,20)), (range(40,59))
>>> p
([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
 range(40, 59))

-- 
Jim

"Stop, Harold! That bagel has radishes!"
"Thank God, Mary - you've saved me again!"


More information about the Tutor mailing list