Govt. Exams
Entrance Exams
Python uses the hash symbol (#) for single-line comments. The other syntaxes are used in other programming languages.
int(num) converts the string '123' to the integer 123. The result is an integer type.
The string 'India' has 5 characters (I, n, d, i, a), so len('India') returns 5.
5.0 is a floating-point number, so type(5.0) returns <class 'float'>.
Tuples are immutable in Python, meaning their elements cannot be changed after creation. Lists, dictionaries, and sets are all mutable.
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.