Answer:
# Get input and strip any leading/trailing spaces
inputList = input('Enter list: ').strip()
def issorted(lst):
  if len(lst) < 2:
    return True
 Â
  current = 1
  prev = 0
  while current < len(lst):
    # Compare if current value is less than the previous one
    if int(lst[current]) < int(lst[prev]):
      return False
   Â
    prev = current
    current += 1
 Â
  return True
# Convert input to list
inputList = inputList.split(' ')
# Print output
if issorted(inputList):
  print("The list is already sorted​")
else:
  print("The list is not sorted")