πŸ“Š Python
Q. Amongst which of the following is / are true about the while loop?
  • (A) It continually executes the statements as long as the given condition is true
  • (B) It first checks the condition and then jumps into the instructions
  • (C) The loop stops running when the condition becomes fail, and control will move to the next line of code.
  • (D) All of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the mentioned above
πŸ“Š Python
Q. The ___ is a built-in function that returns a range object that consists series of integer numbers, which we can iterate using a for loop.
  • (A) range()
  • (B) set()
  • (C) dictionary{}
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (A) range()
πŸ“Š Python
Q. Amongst which of the following is / are true with reference to loops in Python?
  • (A) It allows for code reusability to be achieved.
  • (B) By utilizing loops, we avoid having to write the same code over and over again.
  • (C) We can traverse through the elements of data structures by utilizing looping.
  • (D) All of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the mentioned above
πŸ“Š Python
Q. A function is a group of related statements which designed specifically to perform a ___.
  • (A) Write code
  • (B) Specific task
  • (C) Create executable file
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (B) Specific task
πŸ“Š Python
Q. Amongst which of the following shows the types of function calls in Python?
  • (A) Call by value
  • (B) Call by reference
  • (C) Both A and B
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (C) Both A and B
πŸ“Š Python
Q. What will be the output of the following Python code?
Code:
def show(id,name):
    print("Your id is :",id,"and your name is :",name)

show(12,"deepak")
  • (A) Your id is: 12 and your name is: deepak
  • (B) Your id is: 11 and your name is: Deepak
  • (C) Your id is: 13 and your name is: Deepak
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (A) Your id is: 12 and your name is: deepak
πŸ“Š Python
Q. Amongst which of the following is a function which does not have any name?
  • (A) Del function
  • (B) Show function
  • (C) Lambda function
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (C) Lambda function
πŸ“Š Python
Q. Amongst which of the following is / are the key functions used for file handling in Python?
  • (A) open() and close()
  • (B) read() and write()
  • (C) append()
  • (D) All of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the mentioned above
πŸ“Š Python
Q. Amongst which of the following is / are needed to open an existing file?
  • (A) filename
  • (B) mode
  • (C) Both A and B
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (C) Both A and B
πŸ“Š Python
Q. The function file_object.close() is used to ___.
  • (A) To open the existing file
  • (B) To append in an opened file
  • (C) To close an opened file
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) To close an opened file