Python Programming Flashcard
Flashcard
•
Computers
•
University
•
Hard
Wayground 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
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
12 questions
Product Design and Process Selection
Flashcard
•
University
10 questions
Strategies to Avoid Communication Breakdown
Flashcard
•
11th - 12th Grade
16 questions
Fortune teller
Flashcard
•
Professional Development
10 questions
Part 9 - 10 idioms for speaking
Flashcard
•
University
10 questions
GT 3rd Q2: aud-, vis- (Flashcard)
Flashcard
•
KG - University
10 questions
Flashcards about Earth
Flashcard
•
University
10 questions
Trophic Levels in Ecosystems
Flashcard
•
University
11 questions
AT WORK 1
Flashcard
•
University
Popular Resources on Wayground
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
4 questions
Activity set 10/24
Lesson
•
6th - 8th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
How to Email your Teacher
Quiz
•
Professional Development
15 questions
Order of Operations
Quiz
•
5th Grade
30 questions
October: Math Fluency: Multiply and Divide
Quiz
•
7th Grade
Discover more resources for Computers
10 questions
Halloween Movies Trivia
Quiz
•
5th Grade - University
7 questions
Central Idea of Informational Text
Interactive video
•
4th Grade - University
7 questions
Review for You: Using Commas
Interactive video
•
4th Grade - University
5 questions
Using Context Clues
Interactive video
•
4th Grade - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
14 questions
Eat Healthy,Be Healty
Quiz
•
4th Grade - University
7 questions
Safari Scholar: Searching for Subject-Verb Agreement
Interactive video
•
4th Grade - University