Q. What is the output of the following code?

Code:
myList = ['a','b','c','d']
print "".join(myList)
  • (A) [‘a’,’b’,’c’,’d’]
  • (B) abcd
  • (C) Null
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) abcd
Explanation: “” describes a null string and the join() function combines the elements of the list into a string.
Explanation by: Rajeev Malhotra
“” describes a null string and the join() function combines the elements of the list into a string.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
180
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Rajeev Malhotra
Publisher
πŸ“ˆ
89%
Success Rate