Aptitude Reasoning English GK Computer Knowledge Programming Skill Banking Software Testing



Question - 1

What will be the output of the following Python expression if x=56.236?

print("%.2f"%x)

  • 56.236
  • 56.23
  • 56.0000
  • 56.24
Solutions
Question - 2

Which of these is the definition for packages in Python?

  • A set of main modules
  • A folder of python modules
  • A number of files containing Python definitions and statements
  • A set of programs making use of Python modules
Solutions
Question - 3

What will be the output of the following Python function?

len(["hello",2,4,6])

  • Error
  • 6
  • 4
  • 3
Solutions
Question - 4

What is the order of namespaces in which Python looks for an identifier?

  • Python first searches the built-in namespace, then the global namespace and finally the local namespace
  • Python first searches the built-in namespace, then the local namespace and finally the global namespace
  • Python first searches the local namespace, then the global namespace and finally the built-in namespace
  • Python first searches the global namespace, then the local namespace and finally the built-in namespace
Solutions
Question - 5

What will be the output of the following Python statement?

f = foo()
format(f)

  • str()
  • format()
  • __str__()
  • __format__()
Solutions
Question - 6

Which one of the following is not a keyword in Python language?

  • pass
  • assert
  • eval
  • nonlocal
Solutions
Question - 7

What will be the output of the following Python code?

  1. class tester:
  2.     def __init__(self, id):
  3.         self.id = str(id)
  4.         id="224"
  5.  
  6. >>>temp = tester(12)
  7. >>>print(temp.id)

  • 12
  • 224
  • None
  • Error
Solutions
Question - 8

Which module in the python standard library parses options received from the command line?

  • getarg
  • getopt
  • main
  • os
Solutions
Question - 9

What arithmetic operators cannot be used with strings in Python?

  • *
  • +
  • All of the above
Solutions
Question - 10

To add a new element to a list we use which Python command?

  • list1.addEnd(5)
  • list1.addLast(5)
  • list1.append(5)
  • list1.add(5)
Solutions
Question - 11

Study the following function:

round(4.576)

What will be the output of this function?

  • 4
  • 3
  • 576
  • 5
Solutions
Question - 12

How many control statements python supports?

  • Four
  • Five
  • Three
  • None of the above
Solutions
Question - 13

Which of the following keywords is not reversed keyword in python?

  • None
  • class
  • goto
  • and
Solutions
Question - 14

PVM is often called _________.

  • Python interpreter
  • Python compiler
  • Python volatile machine
  • Portable virtual machine
Solutions
Question - 15

Which of the following keywords is used for function declaration in Python language?

  • def
  • function_name
  • define
  • None of these
Solutions
Question - 16

Which of the following objects are present in the function header in python?

  • Function name and Parameters
  • Only function name
  • Only parameters
  • None of these
Solutions
Question - 17

When a user does not use the return statement inside a function in Python, what will return the function in that case.

  • 0
  • 1
  • None
  • No output
Solutions
Question - 18

Which one of the following is the right way to call a function?

  • call function_name()
  • function function_name()
  • function_name()
  • None of these
Solutions
Question - 19

Suppose a user wants to print the second value of an array, which has 5 elements. What will be the syntax of the second value of the array?

  • array[2]
  • array[1]
  • array[-1]
  • array[-2]
Solutions
Question - 20

Which of the following statements is not valid regarding the variable in python?

  • The variable_name can begin with alphabets
  • The variable_name can begin with an underscore
  • The variable_name can begin with a number
  • None of these
Solutions
Tags:
Python MCQ (Multiple Choice Questions), Advanced Python MCQ, Python MCQ Online test,Python MCQ Questions and answers PDF, Python Interview Questions With Answers, Python Technical Questions with full explanation, Most Expected Python Questions