UNIT 3 Python ProgrammingExtra
UNIT 3 Python ProgrammingExtra
MCQS:
3. Python is:
a) High-level and compiled
b) Low-level and interpreted
c) High-level and interpreted
d) Low-level and compiled
10. The explicit conversion of a value from one data type to another is called:
a) Data binding
b) Type casting
c) Overloading
d) Data parsing
Explanation: The is operator in Python checks identity equality, meaning it checks whether
two variables point to the same object in memory, not whether their values are equal.
26. A function in the math library to calculate the square root is:
a) math.pow()
b) math.sqrt()
c) math.abs()
d) math.exp()
27. The correct way to install a Python library like Numpy is:
a) install numpy
b) python install numpy
c) pip install numpy
d) conda numpy
loc[] can also be used to assign values to a new column, for example: df.loc[:,
'new_column'] = value, but insert() is specifically designed for inserting a column at a
particular position in the DataFrame.
29. Which function is used to check for missing values in a Pandas DataFrame?
a) isnull()
b) dropna()
c) fillna()
d) empty()
32. The default delimiter for reading CSV files in Pandas is:
a) Tab
b) Space
c) Comma
d) Semicolon
33. The most common ratio for splitting data into training and testing sets is:
a) 50:50
b) 80:20
c) 90:10
d) 70:30
42. Which of the following libraries is not used in Python for AI and data science?
a) Scikit-learn
b) NumPy
c) TensorFlow
d) Bootstrap
43. A DataFrame can be created using:
a) Lists
b) Dictionaries
c) Numpy ndarrays
d) All of the above