
Python advanced 4th assessment

Quiz
•
Computers
•
6th Grade
•
Easy
Dhanjit Sarma
Used 3+ times
FREE Resource
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.
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Bitmap v Vector Images

Quiz
•
KG - University
10 questions
Manging Files and Folders

Quiz
•
2nd - 10th Grade
15 questions
Introduction to MS Word

Quiz
•
1st - 10th Grade
10 questions
ICT Grade 6

Quiz
•
6th Grade
10 questions
Python L20 Dictionary

Quiz
•
6th - 8th Grade
10 questions
MOBILE APPLICATION DEVELOPMENT

Quiz
•
1st - 10th Grade
12 questions
Digital Graphics

Quiz
•
6th - 8th Grade
14 questions
Word Processing

Quiz
•
6th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
8 questions
Time Management

Quiz
•
6th Grade
15 questions
Acceptable Use Policy (Quiz)

Quiz
•
6th - 8th Grade
25 questions
Career Vs. Job

Quiz
•
6th - 8th Grade
20 questions
Copyright and Fair Use

Quiz
•
6th - 8th Grade
21 questions
Input Output Storage Device

Quiz
•
5th - 8th Grade