Save
Grade 10 (PHINMA)
Computer 10 (PHINMA)
2nd quarter (COMP10) (PHINMA)
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Cilensya
Visit profile
Cards (46)
What function is used to request user input in Python?
input()
View source
What does the input() function do with the entered data?
It saves the data as a
string
.
View source
What is the syntax for the input() function?
message
= input("This is where you type in your input request: ")
View source
What function is used to print messages on a device's screen?
print()
View source
What format is the print message always in?
String
format.
View source
What happens if the print message is in other objects?
It is converted into a
string
before being printed.
View source
What does the type() function do in Python?
It returns the type of
data
stored in an
object
or
variable
.
View source
What are f-strings in Python?
Formatted
string
literals that embed
expressions
inside string literals.
View source
How do you embed expressions in f-strings?
Using
curly
braces
{
}.
View source
What is the purpose of the int() function?
To convert a number or string to an
integer
.
View source
What does the str() function do?
It converts a specified value into a
string
datatype.
View source
What is the function of float() in Python?
It converts values into
floating
point numbers.
View source
What does the bool() function return?
A
boolean
value.
View source
What is typecasting?
The process of converting a
variable
from one
data type
to another.
View source
If you have a variable height = 5.7, what would height = int(height) return?
5
View source
What does print(type(height)) return after height = int(height)?
<
class
'int'></class>
View source
What does the input() function prompt the user to do?
Enter data.
View source
What does the input() function return?
The entered data as a
string
.
View source
How would you greet a user after getting their name using input()?
print
(
f
"
Hello
{
name
}!")
View source
How do you calculate the area of a rectangle in Python?
area = length
*
width
View source
What is the output of print(f"The area is: {area} square centimeters") if area = 28.0?
The area is:
28.0
square centimeters
View source
In the Shopping Cart Program, how do you calculate the total cost?
total = price
*
quantity
View source
What is the output of print(f"You have bought {quantity} pieces of {item}/s.") if quantity = 5 and item = "Icewater"?
You have bought 5 pieces of Icewater/s.
View source
What is the initial value of friends in the sample arithmetic operators?
0
View source
What does friends += 2 do to the variable friends?
It
increases
the value of friends by
2.
View source
What are the augmented assignment operators in Python?
+
= for
addition
-
= for
subtraction
*
= for
multiplication
/
= for
division
**
= for
exponentiation
%
= for
remainder
View source
What does the round() function do?
It rounds a floating-point number to the
nearest integer.
View source
What is the output of print(result) if result = round(3.14)?
3
View source
What does the abs() function return?
The
absolute value
of a number.
View source
What is the output of print(result) if result = abs(-4)?
4
View source
What does the pow() function do?
It raises a number to the
power
of another number.
View source
What is the output of print(result) if result = pow(4, 2)?
16
View source
What does the max() function return?
The
maximum
value among the given arguments.
View source
What is the output of print(result) if result = max(3.14, 4, 5)?
5
View source
What does the min() function return?
The
minimum
value among the given arguments.
View source
What is the output of print(result) if result = min(3.14, 4, 5)?
1.14
View source
What is the output of print(math.pi) after importing the math module?
1.141592653589793
View source
What is the value of the mathematical constant
e
e
e
in Python's math module?
1.718281828459045
View source
What does the function
m
a
t
h
.
c
e
i
l
(
x
)
math.ceil(x)
ma
t
h
.
ce
i
l
(
x
)
do in Python?
It returns the
smallest
integer
greater
than
or
equal
to
x
x
x
View source
If
x
=
x =
x
=
9.4
9.4
9.4
, what is the result of
m
a
t
h
.
c
e
i
l
(
x
)
math.ceil(x)
ma
t
h
.
ce
i
l
(
x
)
?
10
View source
See all 46 cards