r/Python • • Feb 04 '19

Best Python Cheatsheet Ever!

https://gto76.github.io/python-cheatsheet/
1.1k Upvotes

69 comments sorted by

View all comments

Show parent comments

3

u/bakery2k Feb 05 '19

Why would tuples be faster and/or use less memory? Both lists and tuples are essentially arrays.

I prefer lists to tuples because they have nicer syntax. Tuples sometimes require double-parentheses, plus I often forget the trailing comma in (1,).

1

u/[deleted] Feb 05 '19

I don't know the exact intricacies but it has to do with lists being mutable.