Save
2ND YEAR - 2ND SEM ( BSCE )
COMPROG
MODULE 6
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Chinee 🌷
Visit profile
Cards (57)
What are variables used for in programming?
To store data referenced during
execution
View source
What is a variable in programming?
A name assigned to a
value
View source
Do Python variables require explicit type declaration?
No, type is
inferred
from assigned value
View source
What characters can variable names contain?
Letters,
digits
, and underscores
View source
Can a variable name start with a digit?
No
,
it cannot start with a digit
View source
Are variable names in Python case-sensitive?
Yes,
myVar
and
myvar
are different
View source
What should be avoided when naming variables?
Using
Python
keywords
like
if
,
else
,
for
View source
What are the rules for naming variables in Python?
Can contain
letters
,
digits
, underscores
Cannot start with a digit
Case-sensitive
Avoid Python
keywords
View source
How are values assigned to variables in Python?
Using the
= operator
View source
What does dynamic typing mean in Python?
Same
variable
can hold different types
View source
Can multiple variables be assigned values in one line?
Yes,
Python
allows multiple assignments
View source
What is the benefit of assigning the same value to multiple variables?
It initializes variables with the same value
View source
What does type casting refer to?
Converting one
data type
into another
View source
What are some built-in functions for type casting in Python?
int()
,
float()
,
str()
View source
How can you determine the type of a variable in Python?
Using the type()
function
View source
What are the two scopes of variables in Python?
Local
and
global
View source
Where are local variables defined?
Inside a
function
View source
Where are global variables defined?
Outside any
function
View source
How can global variables be accessed inside functions?
Using the
global
keyword
View source
What does the del keyword do in Python?
Removes a variable from the
namespace
View source
What happens after a variable is deleted using del?
Accessing it results in a
NameError
View source
What is an operator in programming?
A symbol that operates on
values
View source
What forms when data and operators are connected?
Expressions
View source
What is the exponentiation operator in Python?
** (
double asterisk
)
View source
What does the exponentiation operator do?
Raises the
left
argument to the
right
argument
View source
What is the result type when at least one argument of ** is a float?
Float
View source
What is the result type when both arguments of ** are integers?
Integer
View source
What is the multiplication operator in Python?
* (
asterisk
)
View source
What is the division operator in Python?
/ (
slash
)
View source
What does the integer division operator (//) do?
Returns the
integer part
of the division
View source
What is the result of integer division with integers?
Integer
result
View source
What happens when integer division involves floats?
Result
is always a float
View source
How is the result of integer division rounded?
To the nearest
lesser
integer
View source
What does the % (percent) sign represent?
The
remainder
after
integer division
View source
What is another name for the % operator in programming?
Modulo
View source
What is the addition operator in Python?
+ (
plus sign
)
View source
What is the subtraction operator in Python?
(
minus sign
)
View source
What is the hierarchy of priorities in Python?
Defines which
operators
act first
View source
What does left-sided binding mean in Python?
Calculations are conducted from
left
to
right
View source
How can the same expression yield different results?
Based on the
order of operations
applied
View source
See all 57 cards