Python - GUI, Numpy and Pandas - Quizizz
Python - GUI, Numpy and Pandas - Quizizz
Worksheets Name
a) The data type of the array elements. b) The number of dimensions of the array.
c) The size of the array in bytes. d) The total number of elements in the array.
a) The number of elements the array can store. b) The dimensions of the array, represented as a tuple.
c) It changes the shape of the array without altering the data. d) It changes the data type of the array elements.
https://quizizz.com/print/quiz/662f36555a482615f6a76e45 1/10
4/30/24, 10:52 AM Python - GUI,Numpy and Pandas | Quizizz
6. Which of the following is the correct way to slice the third column from a 2D NumPy array arr?
a) arr[2] b) arr[2, :]
c) d) arr[..., 2]
arr[:, 2]
a) The shape will be a 2D array with one row. b) The shape will be a 1D array.
c) The shape will be unchanged. d) The shape will be a 2D array with one column.
https://quizizz.com/print/quiz/662f36555a482615f6a76e45 2/10
4/30/24, 10:52 AM Python - GUI,Numpy and Pandas | Quizizz
a) b) np.rot90()
np.flip()
c) d) np.swapaxes()
np.transpose()
10. What does the shape attribute of a NumPy array return when applied to a 3x4 array?
a) (4, 3) b) (3, 4)
c) d)
12 3x4
a) Tk() b) Frame()
c) mainloop() d)
Window()
12. What is the correct way to start the Tkinter event loop?
a) mainloop() b) startloop()
c) beginloop() d) eventloop()
https://quizizz.com/print/quiz/662f36555a482615f6a76e45 3/10
4/30/24, 10:52 AM Python - GUI,Numpy and Pandas | Quizizz
14. How do you change the font color of a label widget in Tkinter?
root = tk.Tk()
button = tk.Button(root, text="Click me!", command=display_message)
button.pack()
label = tk.Label(root, text="Hello, Tkinter!")
label.pack()
root.mainloop()
a) It creates a label that displays a message when clicked. b) It creates a button with the text "Hello, Tkinter!"
c) It creates a button that changes the label text when clicked. d) It creates a label with the text "Click me!".
https://quizizz.com/print/quiz/662f36555a482615f6a76e45 4/10
4/30/24, 10:52 AM Python - GUI,Numpy and Pandas | Quizizz
16. What does the ‘command’ parameter of the ‘Button()’ widget specify?
c) The text displayed on the button. d) The function to execute when the button is clicked.
17. In the context of Tkinter, what does the following code snippet do?
button = tk.Button(root, text="Click me!", command=quit)
a) It creates a button with the text "Click me!" that prints "quit" to b) It creates a button with the text "Click me!" that does nothing
the console when clicked. when clicked.
c) It creates a button with the text "Click me!" that closes the d) It creates a button with the text "Click me!" that opens a new
Tkinter window when clicked. Tkinter window when clicked.
18. What is the missing code in the following snippet to create a Tkinter window with a label displaying "Hello, Tkinter!"?
import tkinter as tk
root = tk.Tk()
label = tk.Label(root, text="Hello, Tkinter!")
label.______()
root.mainloop()
a) add() b) show()
c) display() d) pack()
https://quizizz.com/print/quiz/662f36555a482615f6a76e45 5/10
4/30/24, 10:52 AM Python - GUI,Numpy and Pandas | Quizizz
19. What is the missing code in the following snippet to create a Tkinter entry widget for user input?
import tkinter as tk
root = tk.Tk()
entry = tk.Entry(root)
entry._____(width=30)
entry.pack()
root.mainloop()
a) config b) EntryWidget
c) create_entry d) entry_create
20. What is the missing code in the following snippet to create a Tkinter button with the text "Clear" that clears the text in the entry widget
when clicked?
def clear_entry():
entry.delete(0, tk.END)
button_clear = tk.Button(root, text="Clear", command=clear_entry)
# Missing code
a) button_clear.pack_forget() b) button_clear.pack()
c) Button.pack() d) button_clear.show()
a) Reads data from a CSV file into a DataFrame. b) Plots data from a CSV file.
c) Counts the number of rows in a CSV file. d) Writes data to a CSV file.
https://quizizz.com/print/quiz/662f36555a482615f6a76e45 6/10
4/30/24, 10:52 AM Python - GUI,Numpy and Pandas | Quizizz
22. What is the default number of rows returned by the `head()` method in Pandas?
a) 5 b) All rows
c) 1 d) 10
a) concat() b) merge()
c) join() d) combine()
c) Splits a CSV file into smaller chunks. d) Reads data from a CSV file.
a) total() b) accumulate()
c) sum() d) add()
https://quizizz.com/print/quiz/662f36555a482615f6a76e45 7/10
4/30/24, 10:52 AM Python - GUI,Numpy and Pandas | Quizizz
27. Which method counts the number of non-NA cells for each column or row?
a) total() b) non_na()
c) number() d) count()
a) divide b) split
c) sep d) delim
29. How can you use `head()` to return the first 10 rows of a DataFrame?
a) df.begin(10) b) df.first(10)
c) df.head(10) d) df.top(10)
30. What does the `concat()` function default to when combining DataFrames?
https://quizizz.com/print/quiz/662f36555a482615f6a76e45 8/10
4/30/24, 10:52 AM Python - GUI,Numpy and Pandas | Quizizz
Answer Keys
1. b) The number of dimensions of the array. 2. b) The dimensions of the array, 3. c) It changes the shape of the array without
represented as a tuple. altering the data.
13. c) Tkinter comes pre-installed with Python 14. a) Use the 'fg' option 15. c) It creates a button that changes the
label text when clicked.
16. d) The function to execute when the 17. c) It creates a button with the text 18. d) pack()
button is clicked. "Click me!" that closes the Tkinter
window when clicked.
19. a) config 20. b) button_clear.pack() 21. a) Reads data from a CSV file into a
DataFrame.
https://quizizz.com/print/quiz/662f36555a482615f6a76e45 9/10
4/30/24, 10:52 AM Python - GUI,Numpy and Pandas | Quizizz
https://quizizz.com/print/quiz/662f36555a482615f6a76e45 10/10