Explore our extensive collection of questions and answers to enhance your learning experience and prepare for exams effectively
The ** operator raises a number to a power, e.g., 2 ** 3 = 8.
The floor division // returns 3, the integer part of 15 divided by 4.
The == operator checks if two values are equal, e.g., 5 == 5 is True.
not (True and False) evaluates to True, as True and False is False.
The + operator concatenates lists, resulting in [1, 2, 3, 4].
append() adds a single item to the end of a list, e.g., [1].append(2) makes [1, 2].
tuple([1, 2, 3]) converts the list to a tuple, resulting in (1, 2, 3).
pop() removes and returns the last item, e.g., [1, 2].pop() returns 2.
join() combines a list, e.g., ‘-‘.join([‘a’, ‘b’]) = ‘a-b’.
find(‘b’) returns the index 1 where ‘b’ is found in ‘abc’.