NEW
Font size
WorksheetsSjmit-Q1-[Workshop-MAR-25]
Total questions: 20
Worksheet time: 8mins
What is the correct way to declare a variable in Python?
10 = x
x = 10
x : 10
let x = 10
Which of the following is not a built-in data type in Python?
tuple
list
array
dictionary
What will be the output of the expression 3 * 2 ** 2?
6
12
8
10
How do you create a list in Python?
You create a list in Python using angle brackets, e.g., my_list = <1, 2, 3>.
You create a list in Python using curly braces, e.g., my_list = {1, 2, 3}.
You create a list in Python using square brackets, e.g., my_list = [1, 2, 3].
You create a list in Python using parentheses, e.g., my_list = (1, 2, 3).
Which control structure is used to execute a block of code multiple times?
Loop
Condition
Variable
Function
What keyword is used to define a function in Python?
function
procedure
def
method
What is the output of the following code: print(type(5))?
Int
Float
Char
String
Which of the following is a valid if statement in Python?
if x > 0:
if (x > 0) {
if x > 0: then
if x > 0;
What is the primary purpose of the Matplotlib library?
To create web applications in Python.
To manage databases in Python.
To create static, animated, and interactive visualizations in Python.
To perform data analysis in Python.
How do you create a simple line plot using Matplotlib?
import matplotlib as plt; plt.plot(x, y); plt.show()
import matplotlib.pyplot as plt; x = [1, 2, 3, 4]; y = [10, 20, 25, 30]; plt.plot(x, y); plt.show()
x = [1, 2, 3]; y = [10, 20]; plt.plot(x); plt.show()
import matplotlib.pyplot as plt; plt.plot(); plt.display()
Which function is used to display a plot in Matplotlib?
plt.plot()
plt.visualize()
plt.display()
plt.show()
How can you add a title to a Matplotlib plot?
Set title with plt.plot_title('Your Title Here')
Call plt.title() without any arguments
Use plt.title('Your Title Here')
Use plt.add_title('Your Title Here')
What method is used to set the x-axis label in Matplotlib?
label_x_axis()
set_xlabel()
set_axis_label()
set_x_label()
How do you change the color of a line in a Matplotlib plot?
Change the line color in the settings menu.
Use the 'style' parameter in the plot function.
Use the 'color' parameter in the plot function.
Adjust the color using the 'linecolor' attribute.
What function is used to create a scatter plot in Matplotlib?
bar
line
plot
scatter
Which function is used to create a bar chart in matplotlib
bar()
bar_Chart()
Barchart()
Bargraph
Which command is used to install Matplotlib?
install matplotlib
pip install matplotlib
import matplotlib
load matplotlib
Which function is used to display grid lines in a plot?
grid()
show_grid()
plot_grid()
gridlines()
Which function is used to create multiple subplots in Matplotlib?
subplot()
subplots()
multi_plot()
Plot()
Which of the following is NOT a valid Matplotlib marker style?
'o' (circle)
's' (square)
'+' (plus)
'-' (dash)
