
Python_CSE-Quiz-2
Quiz
•
Computers
•
University
•
Practice Problem
•
Medium
ANJALI JAIN
Used 1+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following Python code?
a=[1,2,3,4,5,6,7,8,9]
print(a[::2])
a=[1,2,3,4,5,6,7,8,9]
print(a[::2])[1,2]
[8,9]
[1,3,5,7,9]
[1,2,3]
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
The code below is manipulating a Python list using the slicing operator. What will be the output?
a=[1,2,3,4,5,6,7,8,9]
a[::2]=10,20,30,40,50,60
print(a)
The code below is manipulating a Python list using the slicing operator. What will be the output?
a=[1,2,3,4,5,6,7,8,9]
a[::2]=10,20,30,40,50,60
print(a)valueError: attempt to assign a sequence of size 6 to an extended slice of size 5
[10, 2, 20, 4, 30, 6, 40, 8, 50, 60]
[1, 10, 3, 20, 5, 30, 7, 40, 9, 50, 60]
none
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following code snippet?
a=[1,2,3,4,5]
print(a[3:0:-1])
a=[1,2,3,4,5]
print(a[3:0:-1])Syntax error
[4, 3, 2]
[4, 3]
[4, 3, 2, 1]
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
def f(value, values):
v = 1
values[0] = 44
t = 3
v = [1, 2, 3]
f(t, v)
print(t, v[0])
def f(value, values):
v = 1
values[0] = 44
t = 3
v = [1, 2, 3]
f(t, v)
print(t, v[0])1 44
31
3 44
11
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the correct command to shuffle the given Python list?
fruit.shuffle()
shuffle(fruit)
random.shuffle(fruit)
random.shuffleList(fruit)
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
arr = [[1, 2, 3, 4],
[4, 5, 6, 7],
[8, 9, 10, 11],
[12, 13, 14, 15]]
for i in range(0, 4):
print(arr[i].pop())
arr = [[1, 2, 3, 4],
[4, 5, 6, 7],
[8, 9, 10, 11],
[12, 13, 14, 15]]
for i in range(0, 4):
print(arr[i].pop())1 2 3 4
1 4 8 12
4 7 11 15
12,13,14,15
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following statements given below is/are true about a Python tuple?
Tuples have structure, and lists have an order
Tuples are homogeneous, and lists are heterogeneous
none
All of them.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
Revisão - Arquitetura de Computadores
Quiz
•
University
8 questions
Cha-ching 2
Quiz
•
1st Grade - University
10 questions
Kiểm tra học kỳ 1 lớp 2
Quiz
•
2nd Grade - University
10 questions
Teste python- Unesp-Jaboticabal
Quiz
•
University
10 questions
Excel 2016 Formato de celda
Quiz
•
University
10 questions
Server Administration- Quiz 1
Quiz
•
12th Grade - University
15 questions
Cuestionario sobre seguridad en línea
Quiz
•
2nd Grade - University
10 questions
Quiz Informatica Jornadas Orientación Asunción
Quiz
•
12th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
