Python Basics
English
0 / 4 Answered
Q1
Easy
What is the output of: print(type(3.14))?
โ
Correct Answer:
B โ <class 'float'>
๐ก Explanation:
3.14 is a floating-point number in Python, so type() returns <class float>.
Q2
Easy
Which keyword is used to define a function in Python?
โ
Correct Answer:
C โ def
๐ก Explanation:
In Python, the def keyword is used to define a function. Example: def my_function():
Q3
Easy
What data structure does Python use for key-value pairs?
โ
Correct Answer:
D โ Dictionary
๐ก Explanation:
Dictionary (dict) stores key-value pairs. Example: {"name": "Alice", "age": 25}
Q4
Easy
What is the output of: print(2 ** 3)?
โ
Correct Answer:
B โ 8
๐ก Explanation:
** is the exponentiation operator in Python. 2 ** 3 = 2ยณ = 8.