Python Programming Flashcard

Flashcard
•
Computers
•
University
•
Hard
Quizizz Content
FREE Resource
Student preview

15 questions
Show all answers
1.
FLASHCARD QUESTION
Front
What is the output of the following code: print(list(range(2, 10, -2)))?
Back
[]
2.
FLASHCARD QUESTION
Front
What will be the output of the following Python code?
def func(x, y=[]):
y.append(x)
return y
print(func(1))
print(func(2))
print(func(3, []))
print(func(4))
Back
[1]
[1, 2]
[3]
[1, 2, 4]
3.
FLASHCARD QUESTION
Front
What will be the output of the following Python code?
s = "hello-world-python"
result = s.split("-") # Splits the string at '-'
output = " | ".join(result) # Joins the split parts with ' | '
print(output)
Back
'hello | world | python'
4.
FLASHCARD QUESTION
Front
What will be the output of the following code?
s = "Python is amazing"
x = s.partition("is")
output = "#".join(x)
print(output)
Back
'Python#is#amazing' (Using partition() and join())
5.
FLASHCARD QUESTION
Front
Which of the following Python data types is immutable? List, Tuple, Dictionary, None of the above
Back
Tuple
6.
FLASHCARD QUESTION
Front
Which of the following operations will result in an error when performed on a Python list? my_list.append(5), my_list[2] = "new_value", my_list.sort(), my_list[5.5] = "error"
Back
my_list[5.5] = "error"
7.
FLASHCARD QUESTION
Front
What will be the output of the following Python snippet?
text = "Hello, Python!"
print(text[text.find("P"):text.find("n")+1])
Back
"Python"
Create a free account and access millions of resources
Similar Resources on Wayground
7 questions
Python dictionary

Flashcard
•
University
15 questions
CSE 102 Exam 3 Practice

Flashcard
•
University
10 questions
Chương 3: Hệ Thống I/O

Flashcard
•
University
11 questions
Practice

Flashcard
•
KG - University
9 questions
Dictionary Flashcard

Flashcard
•
12th Grade
15 questions
Python if statement

Flashcard
•
University
15 questions
Python if statement

Flashcard
•
University
10 questions
Python- Operators

Flashcard
•
12th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade