The Python function used to display definite text on the monitor or other standard output devices is:
- ainput()
- bprint()
- ctype()
- dstr()
150 questions · 12 sections
The Python function used to display definite text on the monitor or other standard output devices is:
To print Bangla text such as আমি বাংলাদেশকে ভালবাসি, we use:
Which of the following is the correct syntax to print Bangla text in Python?
print(আমি বাংলাদেশকে ভালবাসি)print('আমি বাংলাদেশকে ভালবাসি')print = 'আমি বাংলাদেশকে ভালবাসি'print<'আমি বাংলাদেশকে ভালবাসি'>The message passed to print() may be:
Before any object is shown on the screen by print(), it is first transformed into:
The print() function sends output to the:
A variable in a program is best compared to:
The literal English meaning of the word "variable" is:
Information stored in a variable can later be:
Which statement about Python variables is true?
To recognize and use a variable throughout the programme, we must give it a:
To store the value 9 in a variable named number, we write:
number == 99 = numbernumber = 9number : 9The name of a variable must always be:
Which of the following is a valid way to combine two words in a variable name?
My VariableMy_VariableMy-VariableMy@VariableThe first letter of a Python variable's name MUST be one of:
Which of the following is NOT allowed as the first character of a variable name?
After the first letter of a variable name, which of the following may be used?
Which symbol is NOT allowed inside a variable name?
Python is described as a programming language that is:
Because Python is case-sensitive, My_variable and my_variable are treated as:
Saved (reserved) words in Python that cannot be used as variable names are called:
According to the chapter, how many saved keywords does Python 3.10 have?
Which of the following is a Python keyword and therefore NOT usable as a variable name?
Which list contains only Python keywords mentioned in the chapter?
My Variable (with a space) is an incorrect variable name; the correct form is:
My-VariableMyVariable or My_VariableMy Variable!'My Variable'National ID is invalid as a variable name; which of the following corrects it?
National-IDNationalID or National_IDNational.IDNational ID!The variable name 9810 is invalid because:
Which of the following is a CORRECT variable name?
9810abc9$variable@My_name$variable is NOT a valid variable name; the corrected form is:
$_variable_variablevariable$var$iable@My_name is invalid; an acceptable corrected form is:
@MyNameMy_nameMy@nameMy nameWhy can't print itself be used as a variable name?
Which is an acceptable alternative when you want a name similar to print?
printPrint onlyMyprint or print1print at allThe symbol used to store data in a variable in Python is:
===:= only=>The act of placing data into a variable using = is called:
To set the value of age to 25, we write:
age == 25age := 25age = 2525 = ageAfter age = 25, the statement that prints this value is:
print('age')print(age)show(age)age.print()When a new value is assigned to a variable, the previous value is:
Given the following code, what will be printed in order?
1 1 13 3 31 2 33 2 1Reassigning the same variable multiple times demonstrates that:
A data type defines:
Whole numbers in Python are stored as the data type:
int is the short form of:
In EmpId_no = 5, the data type of EmpId_no is:
Fractional (decimal) numbers in Python are stored as the data type:
In Age = 45.50, the data type of Age is:
Textual information stored in a variable is of the data type:
str is the short form of:
Text inside a string variable must be enclosed in:
Given a = 'c', the data type of a is:
Given b = 'This is a string variable', the data type of b is:
bool is the abbreviation of:
The number of distinct values storable in a bool variable is:
The two values a Boolean variable can store are:
In a = True, the data type of a is:
Where is the value of a Python variable stored?
To find the data type of a variable in Python we use:
datatype()kind()type()dtype()For test_variable = 73.07, print(type(test_variable)) will indicate the data type:
For the code print(test_variable) followed by print(type(test_variable)) with test_variable = 73.07, the first printed line will be:
Changing the data type of a variable in Python is called:
Which of the following is NOT one of the three important type casting functions mentioned in the chapter?
int() creates integers from:
float() creates fractional numbers from:
str() creates strings from:
After x = int(1), the value of x is:
After y = int(2.8), the value of y is:
The behaviour of int(2.8) returning 2 shows that int() on a float:
After z = int("3"), the value of z is:
After x = float(1), the value of x is:
After y = float(2.8), the value of y is:
After z = float("3"), the value of z is:
After w = float("4.2"), the value of w is:
After x = str("s1"), the value of x is:
's1' (a string)After y = str(2), the value of y is:
2 (an int)2.0'2' (a string)After z = str(3.0), the value of z is:
3 (an int)'3.0' (a string)To take data from the user during program execution, we use:
read()get()input()scanf()When execution reaches input(), the program:
After the user types something for input():
By default, input() always returns the user's data as the data type:
Given:
To make input() return an integer instead of a string, we use:
int(input())input(int)int.input()input::intAfter test_input = int(input()), type(test_input) is:
To make input() return a float, we wrap it as:
float[input()]input(float)float(input())input.float()To prompt the user with a specific message inside the input call, we write:
input followed by the message on the next lineinput() within quotation marksprint() only=The statement test_input = input('Provide a sentence as an input:') will, on running:
To print extra text together with a variable in print(), we:
When a variable is printed inside print(), its name is written:
$ prefixWhich operator is used for addition in Python?
-*+/Which operator is used for subtraction in Python?
+-*%Which operator is used for multiplication in Python?
x*.&Which operator is used for division (quotient) in Python?
÷\/%Which operator is used for the modulo (remainder) operation in Python?
*/%^The Modulo operator gives:
In result = num1 + num2, the operator + returns:
The division operator / divides the:
In Practical Problem #1, what does the following programme do?
In the same programme the call int(input('...')) is used so that:
If the user inputs 50 and then 100, the output of Practical Problem #1 is:
To modify Practical Problem #1 to print the difference of two numbers, the operator + should be replaced with:
*-/%To modify Practical Problem #1 to print the product of two numbers, the operator should become:
+-*%Which operator checks whether two operands are equal?
===!==>Which operator means "not equal"?
==<>!==!The expression Op1 < 10 is true when:
The relational operator <= returns true when the left operand is:
The expression Op1 > 10 is true when:
The expression Op1 >= 10 is true when Op1 is:
In Op1 == (Op2 + Op3), the relational operator first allows:
Op1, Op2, Op3 in the relational examples represent:
Relational expressions are formed using:
The result of evaluating a relational expression is:
Which of the following pairs of symbols are BOTH valid Python relational operators?
==<==<Which Python statement is used to perform an action based on a condition?
forwhileifdefThe use of the if statement in Python is closely tied to the meaning of:
The condition used in an if statement is generally:
After the condition of an if statement, the line must end with:
;,:.If the if condition is true, Python executes:
If the if condition is false, control:
The block of statements that runs when an if condition is true is called:
To check whether a student passes when the passing score is 40, the appropriate condition uses:
mark < 40mark != 40mark >= 40mark == 0The body of an if-statement may contain:
Which of the following are valid Python data types mentioned in the chapter?
Which combinations of variable names are CORRECT?
MyVariableMy_Variable9810Which combinations are INCORRECT variable names?
My Variable$variable_variableWhich of the following statements about Python are TRUE?
Which of the following are arithmetic operators in Python?
+*%Which of the following are valid Python relational operators?
==!=>=Which of the following are casting (conversion) functions in Python?
int()float()str()After x = '5' and y = int(x) + 3, the value of y is:
After a = 7 and b = 2, the value of a % b is:
After a = 7 and b = 2, the value of a / b is:
After a = 'Hello' and b = ' World', the safest data type to assume for both is:
The line age = 25; print(age) will print:
Reassigning value_now from 1 to 2 to 3 with print after each line shows that variables:
Which of the following pairs is treated as a SAME variable by Python?
Age and agetotal_marks and total_marksRoll and ROLLname1 and Name1Why must we convert input to int before doing arithmetic on numbers entered by the user?
In print('The sum of', num1, 'and', num2, 'is', result), the items separated by commas are printed:
If num1 = 3 and num2 = 4, what does print(num1 * num2) display?
Given age = 45.50, what does print(type(age)) indicate the type to be?
The output of print(type('hello')) indicates the type:
The output of print(type(True)) indicates the type:
To take a fractional input from the user (e.g., 4.2) and store it as a float, we write:
x = input()x = int(input())x = float(input())x = str(input())The chapter says that in Python the data type after assignment can be:
The Python statement if mark >= 40: checks whether mark is:
Which of the following correctly continues an if block in Python (right after the if line)?
if on the same lineAfter a = 5 and a = 'five', what data type does a now hold?
Which of the following is the BEST description of the chapter's view of variables?
Which of the following is NOT a valid variable name?
_temptemp11tempTemp_valueWhich of the following CORRECTLY converts the string "3" to a float?
int("3")str("3")float("3")bool("3")Why is it useful to print the variable name with a comment-style prompt in input() (e.g., input('Insert an integer number:'))?
Which Python operator should we use to find whether a number is divisible by 2 (zero remainder)?
/*%+After the program flow described, which statement best summarises what the chapter teaches?