Govt. Exams
Entrance Exams
The 'in' operator checks for substring presence. 'a' is in 'apple', so it returns True.
Lists are mutable, meaning their elements can be changed after creation. Strings, integers, and tuples are immutable.
String multiplication repeats the string. 'Hello' * 2 produces 'HelloHello'.
append() adds an element at the end, while insert() adds at a specific position. Both are valid methods.
{} and dict() both create empty dictionaries. {} is more concise while dict() is explicit.
The '//' operator performs floor division and returns an integer, while '/' returns a float in Python 3.
Tuples are immutable sequences in Python. Once created, their elements cannot be modified, unlike lists.