0 out of 464 challenges solved
Write a Python function `is_sorted(lst)` that checks whether a given list of numbers is sorted in ascending order. The function should return `True` if the list is sorted and `False` otherwise. #### Example Usage: ```python [main.nopy] print(is_sorted([1, 2, 3, 4, 5])) # Output: True print(is_sorted([5, 3, 2, 1])) # Output: False print(is_sorted([1, 1, 2, 2])) # Output: True ``` #### Constraints: - The input list will only contain numeric values. - An empty list or a list with a single element is considered sorted.
def is_sorted(lst):
"""
Check if the given list is sorted in ascending order.
Args:
lst (list): The list of numbers to check.
Returns:
bool: True if the list is sorted, False otherwise.
"""
# Placeholder for the solution
pass