wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Sjmit-Q1-[Workshop-MAR-25]

Total questions: 20

Worksheet time: 8mins

Name
Class
Date
1.

What is the correct way to declare a variable in Python?

a)

10 = x

b)

x = 10

c)

x : 10

d)

let x = 10

2.

Which of the following is not a built-in data type in Python?

a)

tuple

b)

list

c)

array

d)

dictionary

3.

What will be the output of the expression 3 * 2 ** 2?

a)

6

b)

12

c)

8

d)

10

4.

How do you create a list in Python?

a)

You create a list in Python using angle brackets, e.g., my_list = <1, 2, 3>.

b)

You create a list in Python using curly braces, e.g., my_list = {1, 2, 3}.

c)

You create a list in Python using square brackets, e.g., my_list = [1, 2, 3].

d)

You create a list in Python using parentheses, e.g., my_list = (1, 2, 3).

5.

Which control structure is used to execute a block of code multiple times?

a)

Loop

b)

Condition

c)

Variable

d)

Function

6.

What keyword is used to define a function in Python?

a)

function

b)

procedure

c)

def

d)

method

7.

What is the output of the following code: print(type(5))?

a)

Int

b)

Float

c)

Char

d)

String

8.

Which of the following is a valid if statement in Python?

a)

if x > 0:

b)

if (x > 0) {

c)

if x > 0: then

d)

if x > 0;

9.

What is the primary purpose of the Matplotlib library?

a)

To create web applications in Python.

b)

To manage databases in Python.

c)

To create static, animated, and interactive visualizations in Python.

d)

To perform data analysis in Python.

10.

How do you create a simple line plot using Matplotlib?

a)

import matplotlib as plt; plt.plot(x, y); plt.show()

b)

import matplotlib.pyplot as plt; x = [1, 2, 3, 4]; y = [10, 20, 25, 30]; plt.plot(x, y); plt.show()

c)

x = [1, 2, 3]; y = [10, 20]; plt.plot(x); plt.show()

d)

import matplotlib.pyplot as plt; plt.plot(); plt.display()

11.

Which function is used to display a plot in Matplotlib?

a)

plt.plot()

b)

plt.visualize()

c)

plt.display()

d)

plt.show()

12.

How can you add a title to a Matplotlib plot?

a)

Set title with plt.plot_title('Your Title Here')

b)

Call plt.title() without any arguments

c)

Use plt.title('Your Title Here')

d)

Use plt.add_title('Your Title Here')

13.

What method is used to set the x-axis label in Matplotlib?

a)

label_x_axis()

b)

set_xlabel()

c)

set_axis_label()

d)

set_x_label()

14.

How do you change the color of a line in a Matplotlib plot?

a)

Change the line color in the settings menu.

b)

Use the 'style' parameter in the plot function.

c)

Use the 'color' parameter in the plot function.

d)

Adjust the color using the 'linecolor' attribute.

15.

What function is used to create a scatter plot in Matplotlib?

a)

bar

b)

line

c)

plot

d)

scatter

16.

Which function is used to create a bar chart in matplotlib

a)

bar()

b)

bar_Chart()

c)

Barchart()

d)

Bargraph

17.

Which command is used to install Matplotlib?

a)

install matplotlib

b)

pip install matplotlib

c)

import matplotlib

d)

load matplotlib

18.

Which function is used to display grid lines in a plot?

a)

grid()

b)

show_grid()

c)

plot_grid()

d)

gridlines()

19.

Which function is used to create multiple subplots in Matplotlib?

a)

subplot()

b)

subplots()

c)

multi_plot()

d)

Plot()

20.

Which of the following is NOT a valid Matplotlib marker style?

a)

'o' (circle)

b)

's' (square)

c)

'+' (plus)

d)

'-' (dash)