Q-1. What will be the output of the following Python code?
a=[1,2,3,4,5,6,7,8,9]
print(a[::2])
Python Programming Quiz-03
Quiz
•
Engineering
•
Professional Development
•
Medium
pragya _CSE
Used 10+ times
FREE Resource
23 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
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
1 min • 1 pt
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, 2, 10, 20, 30, 40, 50, 60]
[1, 10, 3, 20, 5, 30, 7, 40, 9, 50, 60]
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
fruit=['apple', 'banana', 'papaya', 'cherry']
fruit.shuffle()
shuffle(fruit)
random.shuffle(fruit)
random.shuffleList(fruit)
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
arr = [1, 2, 3, 4, 5, 6]
for i in range(1, 6):
arr[i - 1] = arr[i]
for i in range(0, 6):
print(arr[i], end = " ")
1 2 3 4 5 6
2 3 4 5 6 1
1 1 2 3 4 5
2 3 4 5 6 6
5.
DRAW QUESTION
2 mins • 2 pts
Draw the flow chart diagram to print the swap two numbers without using intermediate/
temporary variables and also take the input from users.
6.
DRAW QUESTION
2 mins • 2 pts
Make the use of a python program that accepts a sequence of
lines as input and prints the line after making all characters in the
sentence capitalized.
Input: “Hello GL BAJAJ..
Now we start to learn Python Programming Language”.
Output:
HELLO GL BAJAJ..
NOW WE START TO LEARN PYTHON PROGRAMMING
LANGUAGE.
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
fruit_list1 = ['Apple', 'Berry', 'Cherry', 'Papaya']
fruit_list2 = fruit_list1
fruit_list3 = fruit_list1[:]
fruit_list2[0] = 'Guava'
fruit_list3[1] = 'Kiwi'
sum = 0
for ls in (fruit_list1, fruit_list2, fruit_list3):
if ls[0] == 'Guava':
sum += 1
if ls[1] == 'Kiwi':
sum += 20 print (sum)
22
21
0
43
20 questions
EXAMEN FINAL MODULO 02 CIRCUITOS DE VENTILACIÓN
Quiz
•
Professional Development
25 questions
FM II Lab Quiz 1
Quiz
•
Professional Development
28 questions
LA INDUSTRIA 4.0
Quiz
•
Professional Development
20 questions
Energy Economics Quiz
Quiz
•
Professional Development
19 questions
Evaluación Certificación IE
Quiz
•
Professional Development
21 questions
ITED - 4ª edição
Quiz
•
Professional Development
20 questions
Curso reparación de celulares
Quiz
•
Professional Development
20 questions
Egzamin zawodowy styczeń 2024 - PART 1
Quiz
•
Professional Development
15 questions
Multiplication Facts
Quiz
•
4th Grade
25 questions
SS Combined Advisory Quiz
Quiz
•
6th - 8th Grade
40 questions
Week 4 Student In Class Practice Set
Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025
Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)
Quiz
•
9th - 12th Grade
15 questions
June Review Quiz
Quiz
•
Professional Development
20 questions
Congruent and Similar Triangles
Quiz
•
8th Grade
25 questions
Triangle Inequalities
Quiz
•
10th - 12th Grade