Sort List

Easy Lists
Solve in Playground →

Problem Statement

Write a Python program to sort a list of numbers in both ascending and descending order, printing each on a new line.

Input Format

Space-separated integers.

Output Format

Line 1: Ascending sorted list. Line 2: Descending sorted list.

Constraints

1 <= len(arr) <= 50

Sample Input

5 2 8 1 9

Sample Output

1 2 5 8 9
9 8 5 2 1

Explanation

Sort elements ascending and descending.

Starter Code

def sort_list(arr):
    # Write your code here
    pass

arr = list(map(int, input().split()))
s1, s2 = sort_list(arr)
print(*s1)
print(*s2)

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used