πŸ“Š Python
Q. What will be the result of the following expression in Python “2 ** 3 + 5 ** 2”?
  • (A) 65536
  • (B) 33
  • (C) 169
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (B) 33
πŸ“Š Python
Q. Which of the following statements is used to create an empty set in Python?
  • (A) ( )
  • (B) [ ]
  • (C) { }
  • (D) set()
πŸ’¬ Discuss
βœ… Correct Answer: (D) set()
πŸ“Š Python
Q. What arithmetic operators cannot be used with strings in Python?
  • (A) *
  • (B) -
  • (C) +
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (B) -
πŸ“Š Python
Q. What will be the output of the following Python program?
Code:
z=set('abc')
z.add('san')
z.update(set(['p', 'q']))
z
  • (A) {‘a’, ‘c’, ‘c’, ‘p’, ‘q’, ‘s’, ‘a’, ‘n’}
  • (B) {‘abc’, ‘p’, ‘q’, ‘san’}
  • (C) {‘a’, ‘b’, ‘c’, ‘p’, ‘q’, ‘san’}
  • (D) {‘a’, ‘b’, ‘c’, [‘p’, ‘q’], ‘san}
πŸ’¬ Discuss
βœ… Correct Answer: (C) {‘a’, ‘b’, ‘c’, ‘p’, ‘q’, ‘san’}
πŸ“Š Python
Q. Which module in the python standard library parses options received from the command line?
  • (A) getarg
  • (B) getopt
  • (C) main
  • (D) os
πŸ’¬ Discuss
βœ… Correct Answer: (B) getopt
πŸ“Š Python
Q. What will be the output of the following Python program?
Code:
def foo(x):
    x[0] = ['def']
    x[1] = ['abc']
    return id(x)
q = ['abc', 'def']
print(id(q) == foo(q))
  • (A) Error
  • (B) None
  • (C) False
  • (D) True
πŸ’¬ Discuss
βœ… Correct Answer: (D) True
πŸ“Š Python
Q. What will be the output of the following Python code?
Code:
class tester:
    def __init__(self, id):
        self.id = str(id)
        id="224"
 
>>>temp = tester(12)
>>>print(temp.id)
  • (A) 12
  • (B) 224
  • (C) None
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) 12
πŸ“Š Python
Q. Python is a ___object-oriented programming language.
  • (A) Special purpose
  • (B) General purpose
  • (C) Medium level programming language
  • (D) All of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (B) General purpose
πŸ“Š Python
Q. Amongst the following, who is the developer of Python programming?
  • (A) Guido van Rossum
  • (B) Denis Ritchie
  • (C) Y.C. Khenderakar
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (A) Guido van Rossum
πŸ“Š Python
Q. Amongst which of the following is / are the application areas of Python programming?
  • (A) Web Development
  • (B) Game Development
  • (C) Artificial Intelligence and Machine Learning
  • (D) All of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the mentioned above