Explore our extensive collection of questions and answers to enhance your learning experience and prepare for exams effectively
The count() method returns the number of times a specified value appears in a list or string.
Since y is an alias for x (same object), modifying y[0] also changes x[0], resulting in [10, 2, 3].
In Python, inheritance is achieved by defining a new class with the class keyword and specifying the parent class in parentheses.
The add() method adds an element to a set, so {1, 2, 3} with 4 added becomes {1, 2, 3, 4}.
The int() function converts a string or float to an integer, provided the string represents a valid number.
map() applies a specified function to all items in an iterable and returns a map object.
The slice notation [::-1] with a step of -1 reverses the list, so [1, 2, 3] becomes [3, 2, 1].
TensorFlow is a popular Python library for building and training deep learning models.
The break statement terminates the innermost loop containing it and continues execution after the loop.
The + operator concatenates the strings ‘hello’ and ‘world’ into ‘helloworld’.