Pick the odd one out

  1. ord

  2. sort

  3. reverse

  4. foreach


Correct Option: D

AI Explanation

To answer this question, we need to identify the option that does not fit with the others.

Option A) ord - The ord function is used to return the ASCII value of a character. It is a valid function.

Option B) sort - The sort function is used to sort an array or a list in ascending order. It is a valid function.

Option C) reverse - The reverse function is used to reverse the order of elements in an array or a list. It is a valid function.

Option D) foreach - The foreach loop is used to iterate over elements in an array or a list. It is different from the other options, which are functions or methods. It is the odd one out in this context.

Therefore, the correct answer is D) foreach.

Find more quizzes: