python q3

python q3

University

15 Qs

quiz-placeholder

Similar activities

ITE TEST 2

ITE TEST 2

University

20 Qs

Hands-on Modul 3

Hands-on Modul 3

University

10 Qs

Visual Basic 2010

Visual Basic 2010

8th Grade - University

10 Qs

CS100||MsWord

CS100||MsWord

University

10 Qs

Skill Competition Quiz 2024

Skill Competition Quiz 2024

10th Grade - University

20 Qs

Types of Mass Media

Types of Mass Media

10th Grade - Professional Development

11 Qs

Software dan Hardware

Software dan Hardware

University

10 Qs

Coding Karel 2

Coding Karel 2

KG - University

20 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