πŸ“Š Python
Q. Which one of the following is the use of function in python?
  • (A) Functions don’t provide better modularity for your application
  • (B) you can’t also create your own functions
  • (C) Functions are reusable pieces of programs
  • (D) All of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (C) Functions are reusable pieces of programs
πŸ“Š Python
Q. Which of the following Python statements will result in the output: 6?
Code:
A = [[1, 2, 3],
     [4, 5, 6],
     [7, 8, 9]]
  • (A) A[2][1]
  • (B) A[1][2]
  • (C) A[3][2]
  • (D) A[2][3]
πŸ’¬ Discuss
βœ… Correct Answer: (B) A[1][2]
πŸ“Š Python
Q. What is the maximum possible length of an identifier in Python?
  • (A) 79 characters
  • (B) 31 characters
  • (C) 63 characters
  • (D) none of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (D) none of the mentioned
πŸ“Š Python
Q. What will be the output of the following Python program?
Code:
i = 0
while i < 5:
    print(i)
    i += 1
    if i == 3:
        break
else:
    print(0)
  • (A) error
  • (B) 0 1 2 0
  • (C) 0 1 2
  • (D) none of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (C) 0 1 2
πŸ“Š Python
Q. What will be the output of the following Python code?
Code:
x = 'abcd'
for i in range(len(x)):
    print(i)
  • (A) error
  • (B) 1 2 3 4
  • (C) a b c d
  • (D) 0 1 2 3
πŸ’¬ Discuss
βœ… Correct Answer: (D) 0 1 2 3
πŸ“Š Python
Q. What are the two main types of functions in Python?
  • (A) System function
  • (B) Custom function
  • (C) Built-in function & User defined function
  • (D) User function
πŸ’¬ Discuss
βœ… Correct Answer: (C) Built-in function & User defined function
πŸ“Š Python
Q. What will be the output of the following Python program?
Code:
def addItem(listParam):
    listParam += [1]
 
mylist = [1, 2, 3, 4]
addItem(mylist)
print(len(mylist))
  • (A) 5
  • (B) 8
  • (C) 2
  • (D) 1
πŸ’¬ Discuss
βœ… Correct Answer: (A) 5
πŸ“Š Python
Q. Which of the following is a Python tuple?
  • (A) {1, 2, 3}
  • (B) {}
  • (C) [1, 2, 3]
  • (D) (1, 2, 3)
πŸ’¬ Discuss
βœ… Correct Answer: (D) (1, 2, 3)
πŸ“Š Python
Q. What will be the output of the following Python code snippet?
Code:
z=set('abc$de')
'a' in z
  • (A) Error
  • (B) True
  • (C) False
  • (D) No output
πŸ’¬ Discuss
βœ… Correct Answer: (B) True
πŸ“Š Python
Q. What will be the output of the following Python expression?
Code:
round(4.576)
  • (A) 4
  • (B) 4.5
  • (C) 5
  • (D) 4.6
πŸ’¬ Discuss
βœ… Correct Answer: (C) 5