
python q3

Quiz
•
Computers
•
University
•
Medium
Standards-aligned
Melissa Guillermo
Used 34+ times
FREE Resource
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()
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Arrays in C (II yr 02.07.2020)

Quiz
•
University
10 questions
csharp

Quiz
•
University
17 questions
Arrays recap

Quiz
•
9th Grade - University
20 questions
Beginner Quiz on ML and Python Basics

Quiz
•
University
20 questions
DSA Energizer

Quiz
•
University
10 questions
Structure Data Review

Quiz
•
University - Professi...
15 questions
Quiz Algoritma Looping

Quiz
•
University
10 questions
C Program Array and strings

Quiz
•
University
Popular Resources on Wayground
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
20 questions
ELA Advisory Review

Quiz
•
7th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns

Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
11 questions
NFL Football logos

Quiz
•
KG - Professional Dev...
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
38 questions
Unit 6 Key Terms

Quiz
•
11th Grade - University
20 questions
La Hora

Quiz
•
9th Grade - University
7 questions
Cell Transport

Interactive video
•
11th Grade - University
7 questions
What Is Narrative Writing?

Interactive video
•
4th Grade - University