Page 127 - PortGPT_V2.1_C6_Flipbook
P. 127
test Your skiLLs
1. Tick () the correct option.
a. What will be the output of the following expression?
22 % 3
(i) 7 (ii) 1
(iii) 0 (iv) 5
b. The statement using AND operator results true if _________________.
(i) both operands are true (ii) both operands are false
(iii) either of the operands is true (iv) neither of the operands is true
c. Which one of the following has the highest precedence in a logical expression?
(i) Addition (ii) Multiplication
(iii) Exponential (iv) Parentheses
d. Which of the following is true?
(i) Comments are for programmers for better understanding of the program.
(ii) Python Interpreter ignores comments.
(iii) You can write multi-line comments in Python using triple quotes, either ‘’’ or “””.
(iv) All of these
e. Which of the following symbol(s) is/are used for comments in Python?
(i) // (ii) ‘’
(iii) /**/ (iv) #
2. Fill in the blanks using the words given in the help box.
string, Guido van Rossum, false, input( ), assignment
a. Python was developed by ____________.
b. The ____________ operators are used to assign the value of the right expression to the left
operand.
c. A ____________ value is a collection of one or more characters put in single or double quotes.
d. The ____________ function allows to take user’s input while a program executes.
e. Logical OR operator returns ____________, if both operands are false.
3. Write ‘T’ for True and ‘F’ for False.
a. The print() function allows to display output on the screen while a
program executes. ____________
Introduction to Programming 125

