Python advanced 4th assessment

Python advanced 4th assessment

6th Grade

10 Qs

quiz-placeholder

Similar activities

Data Representation - Metadata

Data Representation - Metadata

3rd - 11th Grade

10 Qs

PowerPoint Basics

PowerPoint Basics

6th - 8th Grade

13 Qs

ODMQUIZ

ODMQUIZ

6th Grade

10 Qs

Unit 5 - Getting Started with MS Excel 2016

Unit 5 - Getting Started with MS Excel 2016

6th - 12th Grade

10 Qs

ICT 4

ICT 4

4th - 6th Grade

10 Qs

FILE MANEGMENT

FILE MANEGMENT

6th Grade

12 Qs

Basic Microsoft Word

Basic Microsoft Word

1st Grade - Professional Development

15 Qs

Digital Computer Graphics

Digital Computer Graphics

KG - University

10 Qs

Python advanced 4th assessment

Python advanced 4th assessment

Assessment

Quiz

Computers

6th Grade

Easy

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?