
Python advanced 4th assessment
Quiz
•
Computers
•
6th Grade
•
Practice Problem
•
Easy
Dhanjit Sarma
Used 3+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the method to add a key-value pair to a dictionary?
dictionary.put(key, value)
dictionary.insert(key, value)
dictionary.add(key, value)
dictionary[key] = value
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to read an entire file in Python?
load()
import()
read()
fetch()
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you write data to a text file in Python?
Use open("filename.txt", "w") as file: file.write("data")'.
Use 'open('filename.txt', 'r') as file: file.write('data')' to write data.
Write data using 'file.write('data')' without opening the file first.
Use 'open('filename.txt', 'a') as file: file.write('data')'.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following: (1, 2) + (3, 4)?
(1, 2, 3, 4)
(1, 2, 3)
(4, 6)
(3, 4, 5)
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you access a value in a nested dictionary?
Access the value with d.get('key1').get('key2')
Use the syntax d['key1']['key2'] to access the value.
You can retrieve the value using d['key1.key2']
Use d.key1.key2 to access the value.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a valid way to create a tuple?
[1, 2, 3]
(1, 2, 3)
{1, 2, 3}
(1; 2; 3)
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What method would you use to remove a key from a dictionary?
Use 'add()' method.
Use 'pop()' method.
Use 'remove()' method.
Use 'insert()' method.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Google Drive
Quiz
•
KG - University
9 questions
Computer Care
Quiz
•
3rd - 12th Grade
10 questions
Cloud Computing
Quiz
•
6th Grade
10 questions
Scratch - Revision
Quiz
•
6th Grade
14 questions
Robots and sensors G6
Quiz
•
5th - 7th Grade
10 questions
About video
Quiz
•
3rd - 6th Grade
15 questions
Quit TIK-1
Quiz
•
6th - 8th Grade
11 questions
Python Variables
Quiz
•
6th - 8th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
