
Python Practice Test #2

Flashcard
•
Professional Development
•
Professional Development
•
Hard
Wayground Content
FREE Resource
Student preview

30 questions
Show all answers
1.
FLASHCARD QUESTION
Front
What do you expect the following code will print given the first input is apple (stored in variable a) and the second input is banana (stored in variable b)? Options: apple:banana, apple::banana, banana:apple:, banana::apple
Back
banana::apple
Answer explanation
The inputs were swapped during the assignment. x is assigned the value stored inside b, and y is assigned the value stored inside a.
2.
FLASHCARD QUESTION
Front
What will the output be after running the following code snippet? Options: 0, 4, 2, 1
Back
4
Answer explanation
The if clause inside myfun() will evaluate to true since the value passed to the function is >= 4. The if block will then be executed, and the value of 4 will be returned.
3.
FLASHCARD QUESTION
Front
What will the output be after running the following code snippet? Options: ['bananas', ''], ['bananas'], ['apples'], ['apples', 'bananas', '']
Back
['bananas', '']
Answer explanation
The element 'apples' will be removed from the list from the .remove('apples') method
4.
FLASHCARD QUESTION
Front
What will the output be after running the following code snippet? Options: [7, 6, 5, 4, 3, 2, 1], [1, 2, 3, 4, 5, 6, 7], [1, 2, 3, 4, 5, 6], [2, 3, 4, 5, 6, 7]
Back
[7, 6, 5, 4, 3, 2, 1]
Answer explanation
The symbol [:] accesses all elements in the list. [::-1] accesses all elements in the list but in reverse order.
5.
FLASHCARD QUESTION
Front
What will the output be after running the following code snippet? Options: 0b01, 0b11, 0b10, 10
Back
0b10
6.
FLASHCARD QUESTION
Front
What is the output of the following program?
Back
90
7.
FLASHCARD QUESTION
Front
What will the output be after running the following code snippet?
Back
False
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Control Structures

Flashcard
•
University
19 questions
Q2 PYTHON CONDITIONALS

Flashcard
•
University
20 questions
LISTS in Python

Flashcard
•
University
23 questions
Formative #2 Ethical Standards and Guidelines: ACM, AAP and IEEE

Flashcard
•
University
31 questions
Python Dictionary,Tuple and set

Flashcard
•
University
17 questions
AP CSA Unit 3 Review

Flashcard
•
12th Grade
20 questions
Intro to CS Semester 1 Unit 2 flashcard

Flashcard
•
12th Grade
34 questions
Computer Basics and Network Types

Flashcard
•
University - Professi...
Popular Resources on Wayground
10 questions
SR&R 2025-2026 Practice Quiz

Quiz
•
6th - 8th Grade
30 questions
Review of Grade Level Rules WJH

Quiz
•
6th - 8th Grade
6 questions
PRIDE in the Hallways and Bathrooms

Lesson
•
12th Grade
10 questions
Lab Safety Procedures and Guidelines

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

Quiz
•
3rd Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
15 questions
Subtracting Integers

Quiz
•
7th Grade
Discover more resources for Professional Development
11 questions
All about me

Quiz
•
Professional Development
10 questions
How to Email your Teacher

Quiz
•
Professional Development
5 questions
Setting goals for the year

Quiz
•
Professional Development
10 questions
How to Email your Teacher

Quiz
•
Professional Development
20 questions
Employability Skills

Quiz
•
Professional Development