Contents

Amongst which of the following is / are the logical operators in Python?
a) and                                   
b) or
c) not                                     
d) All of these

d

Explanation: Python's logical operators are represented by the terms and, or, and not. In Python, logical operators are used to perform logical operations on the values of variables that have been declared. Either true or false is represented by the value. The truth values provide us with the information we need to figure out the conditions. In Python, there are three types of logical operators: the logical AND, the logical OR, and the logical NOT operators. Keywords or special characters are used to represent operators in a program.


Is Python supports exception handling?
a) Yes                                    
b) No

a

Explanation: Unexpected events that can occur during a program's execution are referred to as exceptions, and they can cause the program's normal flow to be interrupted. Python provides exception handling, which allows us to write less error-prone code while also testing various scenarios that may result in an exception later on in the process.


What is the name of the operator ** in Python?
a) Exponentiation              
b) Modulus
c) Floor division  
d) None of these

a

Explanation: The ** is an exponentiation operator in the Python programming language. In Python, the ** operator is used to raise the number on the left to the power of the exponent on the right, which is represented by the symbol **. In other words, in the expression 2 ** 3, 2 is raised to the third power, which is a positive number. In mathematics, we frequently see this expression written as 23, but what is really happening is that the numbers 2 and 3 are being multiplied by themselves three times. In Python, we would get the same result of 8 by running either 2 ** 3 or 2 * 2 * 2.


The % operator returns the ___.
a) Quotient                           
b) Divisor
c) Remainder                      
d) None of these

c

Explanation: The % operator (it is an arithmetic operator) returns the amount that was left over. This is useful for determining the number of times a given number is multiplied by itself.


Amongst which of the following is / are the method of list?
a) append()                          
b) extend()
c) insert()                              
d) All of these

d

Explanation: list.append(x)list.extend(iterable)list.insert(i, x) are the methods of list. list.append(x) - add an item to the end of the list. list.extend(iterable) - extend the list by appending all the items from the iterable. list.insert(i, x) Insert an item at a given position.


The list.pop ([i]) removes the item at the given position in the list?
a) True                                 
b) False

a

Explanation: The external is not a valid variable scope in PHP.