Save
2ND YEAR - 2ND SEM ( BSCE )
COMPROG
MODULE 7
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Chinee 🌷
Visit profile
Cards (24)
What types of data can Python operators be used with?
Numbers
, strings,
boolean
, and more
View source
What are comparison operators used for in Python?
To compare the values of two
operands
View source
How are strings compared in Python?
Based on the
alphabetical
order of characters
View source
What are the comparison operators in Python?
Greater than
: >
Less than
: <
Equal to
: ==
Not equal to
: !=
Greater than or equal to
: >=
Less than or equal to
: <=
View source
What does the Greater Than Operator do?
Returns
True
if left
operand
is greater
View source
What does the Less Than Operator do?
Returns
True
if left
operand
is less
View source
What does the Equal To Operator return?
True
if both
operands
are equal
View source
What does the Not Equal To Operator return?
True if
operands
are not equal
View source
What does the Greater Than or Equal To Operator do?
Returns
True
if
left operand
is greater or equal
View source
What does the Less Than or Equal To Operator do?
Returns
True
if
left operand
is less or equal
View source
What will Python return when comparing 2 and 2?
True
View source
What does the Greater Than Operator return if the left operand is not greater?
Returns
False
View source
What does the Less Than Operator return if the left operand is not less?
Returns
False
View source
What are conditional statements in Python used for?
Execute code based on
conditions
Control the flow of a
program
Make programs behave differently in
situations
View source
What is the simplest form of a conditional statement in Python?
If statement
View source
What does an if statement do?
Executes code if the
condition
is true
View source
What is a shorthand if statement?
A
single-line
if
statement
View source
What does the else statement do?
Executes code if the
if condition
is false
View source
What is the purpose of the elif statement?
To check multiple
conditions
View source
What does nested if…else mean?
An if-else inside another
if statement
View source
What is a ternary conditional statement?
A compact way to write an
if-else
condition
View source
What is the significance of indentation in Python?
Defines a group of statements
Often referred to as a
suite
Controls the flow of
execution
View source
What is a sample problem involving if statements?
Ask user for
effort mark
Display meaning (O, S, NI)
View source
What is a sample problem involving elif statements?
Determine Conduct Mark based on
demerit points
Use
ranges
for A, B, C, D
View source