input()function! Clearly, this is a major faux pas, as most Python users know that it's a security risk and that
raw_input()should always be used instead (and the main reason why
raw_input()replaces and is renamed as
input()in Python 3).
- along with lists are two of Python's most popular data structures
- are mostly immutable but there are workarounds, and
- should be used for application data manipulation
index()) that led to inefficiencies (and poor practices) where developers used tuples for the reason we just outlined but needed to either get a count on how many times an object appeared in that sequence or wanted to find the index of the first appearance of an object. They would have to convert that tuple to a list, just to call those methods. Starting in 2.6, tuples now have those (and only those) methods to avoid this extra nonsense.