LinkedIn Python Skill Assessment Quiz Answers

What happens when you use the build-in function any() on a list?

Latest Update on 25th January, 2022 by Certification Course Answers

What happens when you use the build-in function any() on a list?

  1.  The any() function will randomly return any item from the list.
  2.  The any() function returns True if any item in the list evaluates to True. Otherwise, it returns False.
  3.  The any() function takes as arguments the list to check inside, and the item to check for. If “any” of the items in the list match the item to check for, the function returns True.
  4.  The any() function returns a Boolean value that answers the question “Are there any items in this list?”

Correct Answer:

  •  The any() function returns True if any item in the list evaluates to True. Otherwise, it returns False.

example:

if any([True, False, False, False]) == True:
    print('Yes, there is True')
>>> Yes, there is True

Latest Updates

No posts found in this category.