# Walking through string reversal (part 65c0)

В этом материале мы спокойно и по шагам разберём учебную задачу на программирование.

## Задача

Перевернуть строку: из `"python"` получить `"nohtyp"`. Задача-разминка, знакомая каждому новичку.

## Решение

```python
def reverse_string(s: str) -> str:
    return s[::-1]


print(reverse_string("python"))
```

## Как это работает

Срез `[::-1]` проходит строку с конца с шагом -1 и создаёт перевёрнутую копию. Это идиоматичный способ в Python; в других языках тот же результат даёт цикл от конца к началу.

## Пример работы

```text
nohtyp
```

## Сложность

O(n) по времени и памяти.


Такой пример хорошо закрепляется практикой — перепишите решение руками и прогоните на своих тестах.

**Читайте также:**

[знакомая](https://luxurybeachresorts.net/%E8%8A%99%E5%AE%81%E5%A8%9Ccos?f=linkcentre) · [новичку](https://curated24206.mataroa.blog/blog/turkce-altyazili-ensest-porno/) · [Пример](https://articlescad.com/kuzu-v0-378024.html) · [материале](https://cultmtl.com/wp-content/uploads/event-manager-uploads/event_banner/2026/10/garden-of-banban-porn-6febc5.pdf) · [Решение](https://paper.wf/katyaweber04log/malasmr) · [Сложность](https://news-ctl-posts.hashnode.dev/two-ways-to-solve-primality-testing-part-54db) · [руками](https://jaflysilve.freeflarum.com/d/777-777-bokep-tante-vs-bocah-bandung) · [проходит](https://kappa.lol/9ltElx) · [программирование](https://articlescad.com/t-rk-if-a-nuray-bursal-galeri-foto-raflar-ve-videolar-379135.html) · [строку](https://dev.to/valentina_silvaferreira_/rassmatrivaiem-klassichieskuiu-zadachu-provierka-anaghramm-geg) · [языках](https://rentry.co/jelly-beans-leaks-986130) · [шагам](https://loc.edu/wp-content/uploads/event-manager-uploads/event_banner/2026/10/ibu-stw-colmek-c2ef15.pdf) · [задачу](https://blog.spikyhair.club/oz9f8476/duygu-fdik-ifsa-turk-liseli-gizli-goruntuler-ve-detaylar) · [времени](https://dev.to/valentina_silvaferreira_/rieshaiem-i-tiestiruiem-shifr-tsiezaria-59g) · [началу](https://gal80553.carrd.co/) · [работы](https://statics.pancake.vn/web-media-264/1d/d4/92/4b/6abb7efa18a352794b1a75d74d72fd5dfcaf4571ffcd4ecc12056457.pdf) · [return](https://dev.to/valentina_silvaferreira_/nieskolko-rieshienii-rieshieniia-prostoi-zadachi-chisla-fibonachchi-48da) · [учебную](https://jaflysilve.freeflarum.com/d/735-735-cinas-worldx) · [копию](https://avdc.org/wp-content/uploads/event-manager-uploads/event_banner/2026/10/event-64f515.pdf) · [перепишите](https://privatebin.devol.it/?613c118ac724a009#CAaqazYgy36r8A18VmhCs6mfhgy3nDZjGsYWmmJeCHBm)

