TGViewer
Python Community Python Community @python_community_ru · 11.6K subscribers
Post #1673 4.36K
☝️Как развернуть список?

👉 Обратите внимание, что reverse() вызывается в списке и изменяет его. Сама функция не возвращает измененный список:

li = ['a','b','c']

print(li)
li.reverse()
print(li)
#=> ['a', 'b', 'c']
#=> ['c', 'b', 'a']

Python Community
  • 👍 3
More from @python_community_ru
  1. Oct 9, 2026‍Вышел Python 3.15: ленивые импорты, frozendict, UTF-8 по умолчанию и JIT, который наконец…
  2. Oct 8, 2026🦙 Ollaya: запуск моделей принятия решений в стиле Ollama. Скачиваете модель, поднимаете л…
  3. Oct 7, 2026‍Python 3.15 почти готов: вышел RC3, финальный релиз 9 октября Python 3.15.0rc3 вышел 2 ок…
  4. Oct 6, 2026🐍 Python Workers в Cloudflare вышли в GA Cloudflare официально сделала Python полноценным…
  5. Oct 5, 2026‍🖥 Python-дайджест недели: PyPy 8 с Python 3.12, отладка None и фреймворки для агентов Py…
  6. Oct 4, 2026🐍 Python тормозит? В 3.15 добавили инструмент, который покажет где Tachyon (`profiling.sa…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →