stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Release #4 + Review Flashcards | StudBud
Explore
/
Release #4 + Review
Release #4 + Review
19 terms
·
StudBud Administration
conditionals and logic
Flashcards
19 cards
F
Practice quiz
P
Host live
L
Questions
19
Answers
1
What will be printed?
Syntax Error
Nothing
Greater than 5
x > 5
2
Which keyword is used to define a function in Python?
function
define
fun
def
3
What does a return statement do in a function?
Ends the function
Prints a message
Outputs a value from the function
Takes input from the user
4
Which of the following statements is false about the not operator?
It works with boolean expressions
it inverts the boolean value
it can be used with numbers directly
It can be used in conditional statements
5
What is the purpose of a function in Python?
Print output to the console
Store multiple values
Store user input
Perform a specific task and avoid repetition
6
What do we primarily use Python for in this course?
Data science
Teach coding fundamentals
Web development
Game development
7
What is the result of 10 % 3 in Python?
1
3
0
10
8
What is a parameter in a function?
A value returned by a function
An input value used inside a function
A special variable only for loops
A type of mathematical operator
9
When does an else statement execute?
When the elif condition is true
When the if condition is false
When there is an error
When the if condition is true
10
Which statement is used to execute code only when a condition is met?
if
while
for
def
11
What will 5 // 2 return?
2
2.5
3
2.0
12
Which of these is an example of a logical operator in Python?
%
+
==
and
13
Which of the following is a correct variable name in Python?
my-variable
My Variable
my_variable
3cats
14
Which statement correctly checks if x is between 5 and 10?
if 5 < x < 10:
if x > 5 or x < 10:
if x >= 5 and x <= 10: AND if 5 < x < 10:
if x >= 5 and x <= 10:
15
What symbol is used for powers/exponents in Python?
*
//
**
^
16
What will be printed?
Hello, name
Alice, Hello
Hello, Alice
Error
17
What keyword is used to specify an alternative condition in Python?
switch
elif
else
elseif
18
Which of the following comparison operators is used to check if two values are equal?
>=
!=
==
=
19
What does the input() function do?
declares a variable
prints a value
performs arithmetic
takes user input