Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Task: Sorting Data | Lists, Loops And Functions
Python: For Beginners
Секція 2. Розділ 3
single

single

Task: Sorting Data

Свайпніть щоб показати меню

Now that you master closures, let's sort some data.

Sorting data is a key skill. Here's how to use sorted():

123
data = [5, 2, 8, 1] result = sorted(data) print(result) # Printing the result

In Python, the sorted() function returns a new list and doesn't modify the original. it's a pure function.

Завдання

Проведіть, щоб почати кодувати

We need you to sort the list numbers in ascending order and store the result in sorted_numbers.

  • Assign the sorted version of numbers to the variable sorted_numbers;
  • Use the sorted function to do this;
  • Print sorted_numbers.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 3
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

some-alt