πŸ“Š Python
Q. The write() method takes a string as an argument and ___.
  • (A) writes it to the text file
  • (B) read from the text file
  • (C) append in a text file
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (A) writes it to the text file
πŸ“Š Python
Q. The seek() method is used to ___.
  • (A) Saves the file in secondary storage
  • (B) Position the file object at a particular position in a file
  • (C) Deletes the file form secondary storage
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (B) Position the file object at a particular position in a file
πŸ“Š Python
Q. mongst which of the following function is / are used to create a file and writing data?
  • (A) append()
  • (B) open()
  • (C) close()
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (B) open()
πŸ“Š Python
Q. The module Pickle is used to ___.
  • (A) Serializing Python object structure
  • (B) De-serializing Python object structure
  • (C) Both A and B
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (C) Both A and B
πŸ“Š Python
Q. Amongst which of the following is / are the method of convert Python objects for writing data in a binary file?
  • (A) set() method
  • (B) dump() method
  • (C) load() method
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (B) dump() method
πŸ“Š Python
Q. Amongst which of the following is / are the method used to unpickling data from a binary file?
  • (A) load()
  • (B) set() method
  • (C) dump() method
  • (D) None of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (B) set() method
πŸ“Š Python
Q. A text file contains only textual information consisting of ___.
  • (A) Alphabets
  • (B) Numbers
  • (C) Special symbols
  • (D) All of the mentioned above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the mentioned above
πŸ“Š Python
Q. To add a new element to a list we use which Python command?
  • (A) list1.addEnd(5)
  • (B) list1.addLast(5)
  • (C) list1.append(5)
  • (D) list1.add(5)
πŸ’¬ Discuss
βœ… Correct Answer: (C) list1.append(5)
πŸ“Š Python
Q. What will be the output of the following Python code?
Code:
print('*', "abcde".center(6), '*', sep='')
  • (A) * abcde *
  • (B) *abcde *
  • (C) * abcde*
  • (D) * abcde *
πŸ’¬ Discuss
βœ… Correct Answer: (B) *abcde *
πŸ“Š Python
Q. What will be the output of the following Python code?
Code:
>>>list1 = [1, 3]
>>>list2 = list1
>>>list1[0] = 4
>>>print(list2)
  • (A) [1, 4]
  • (B) [1, 3, 4]
  • (C) [4, 3]
  • (D) [1, 3]
πŸ’¬ Discuss
βœ… Correct Answer: (C) [4, 3]