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
Similar Resources on Wayground
14 questions
Python1

Flashcard
•
University
10 questions
Python Comparisons

Flashcard
•
12th Grade
10 questions
Logic Gates #2

Flashcard
•
KG - 12th Grade
18 questions
Basic Python and Console Interaction Flashcard

Flashcard
•
12th Grade
8 questions
Computer Fundamentals

Flashcard
•
KG - University
7 questions
Essential Python Knowledge for Students

Flashcard
•
University
11 questions
Python [Basic]

Flashcard
•
KG
16 questions
G12- Selection and Decision Making- Flash cards

Flashcard
•
12th Grade - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University