# String slicing in Python

**URL:** <https://discuss.python.org/t/string-slicing-in-python/25651>\
**Category:** Python Help\
**Created:** [April 10, 2023, 12:26pm UTC](https://discuss.python.org/t/string-slicing-in-python/25651 "2023-04-10T12:26:25Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![rob42](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/rob42/32/8218_2.png) [@rob42](https://discuss.python.org/u/rob42)\
**Post date:** [April 10, 2023, 1:10pm UTC](https://discuss.python.org/t/string-slicing-in-python/25651/2 "2023-04-10T13:10:30Z")

</div>

You may find that the question on ‘memory’ is addressed [here](https://discuss.python.org/t/python-memory-management/25391).

As for the last two lines of your code (which are the same?)

`print(s[2:] is s[4:])`

If you `print(s[2:], s[4:])`, you’ll see

```plaintext
string ring

```

… which are clearly different, and as such `print(s[2:] is s[4:])` will return `False`

---

_[View the full topic](https://discuss.python.org/t/string-slicing-in-python/25651)._
