python q3

python q3

University

15 Qs

quiz-placeholder

Similar activities

DWDM-2

DWDM-2

University

20 Qs

Tree and Planar Graph

Tree and Planar Graph

University

10 Qs

Understanding Email, Contacts and Calendaring

Understanding Email, Contacts and Calendaring

University

10 Qs

Pra UPS 2

Pra UPS 2

University

20 Qs

Perangkat komputer

Perangkat komputer

University

10 Qs

Logika Fuzzy

Logika Fuzzy

University

10 Qs

Quiz Inf X.B

Quiz Inf X.B

10th Grade - University

20 Qs

BB

BB

University

10 Qs

python q3

python q3

Assessment

Quiz

Computers

University

Practice Problem

Medium

DOK Level 1: Recall

Standards-aligned

Created by

Melissa Guillermo

Used 34+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How do you slice a Python array `arr` to get the first three elements?

`arr[0:2]`

`arr[0:4]`

`arr[:3]`

`arr[1:3]`

Tags

DOK Level 1: Recall

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How do you add multiple items (e.g., [4, 5, 6]) to the end of a Python array `arr`?

`arr.append([4, 5, 6])`

`arr.extend([4, 5, 6])`

`arr.add([4, 5, 6])`

`arr.insert([4, 5, 6])`

Tags

DOK Level 1: Recall

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the purpose of an array in Python?

To perform mathematical operations

To define functions

To store multiple values in one variable

To create loops

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What method is used to add an element at the end of an array in Python?

append()

extend()

copy()

clear()

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output-

f=open('abc.txt','a')

text="xyz"

f.write(text)

f.close()

Writing into the file without erasing old content

Writing into the file by erasing old content

reading from the file without erasing old content

reading from the file by erasing old content

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Mode in the following program to open file for writing in a mode where new data will be added at the end of old data

file =open("poem.txt","__")

r

w

a

r+

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which function read single line at a time?

read()

read(n)

readline()

readlines()

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers