Govt. Exams
Entrance Exams
3.14 is a floating-point number, so type() returns <class 'float'>.
The len() function returns the number of characters (length) in a string.
The comparison operator == checks if x equals y. Since 5 ≠ 10, the result is False.
Tuples are immutable sequences in Python, meaning their contents cannot be changed once created.
Dictionaries in Python use curly braces with key-value pairs separated by colons.
The + operator concatenates strings in Python. Other operators don't perform string concatenation.
The len() function counts all characters including the space. 'hello world' has 11 characters (including 1 space).
Tuples are immutable, meaning their elements cannot be changed after creation. Lists, dictionaries, and sets are mutable.
The floor division operator (//) returns the quotient rounded down to the nearest integer. 10 // 3 = 3.
String slicing [2:5] extracts characters from index 2 to 4 (5 is exclusive). 'Python'[2:5] = 'yth'.