Q. Which of the following functions can be used to sort a list in Python?

  • (A) order()
  • (B) sort()
  • (C) sorted()
  • (D) Both sort() and sorted()
πŸ’¬ Discuss
βœ… Correct Answer: (D) Both sort() and sorted()
Explanation: The `sort()` method sorts a list in place, while `sorted()` returns a new sorted list.
Explanation by: Rati Dubey
The `sort()` method sorts a list in place, while `sorted()` returns a new sorted list.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
83
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Rati Dubey
Publisher
πŸ“ˆ
98%
Success Rate