---
title: "Discussion on \"String Slicing in Python\" | Hashnode"
description: "Discussion on \"String Slicing in Python\". String Slicing and Negative Index"
url: "https://hashnode.com/posts/py-string-slicing/616b18af441bd36daa955c0f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [String Slicing in Python](https://dev2-python.hashnode.dev/py-string-slicing?utm_source=hashnode&utm_medium=feed)

String Slicing and Negative Index

Oct 16, 2021 · 4 min read · dev2-python.hashnode.dev  
Updated May 3, 2022  
Read the article

-   [#string](https://hashnode.com/tag/string)
-   [#python](https://hashnode.com/tag/python)
-   [#python3](https://hashnode.com/tag/python3)
-   [#data](https://hashnode.com/tag/data)

## Written by

[Dev2](https://hashnode.com/@dev2)

@dev2

  
[View profile](https://hashnode.com/@dev2)

## Responses 1

Markdown supported · ⌘↵ to post

[Bikash Daga](https://hashnode.com/@bikashdaga)

[Apr 5, 2022](https://hashnode.com/posts/py-string-slicing/616b18af441bd36daa955c0f/comment/624c28932b09bb392ea5ce1c)

Thank you for sharing this Dev2, nicely written article.

you can add this: Slicing with positive and negative index

**Code:**

```
s = "Welcome to scaler"
s1 = s[3 : -7]
print("positive start index, negative end index:", s1)
# above slice operation can also be written as
s2 = s[-14 : 10]
print("negative start index, positive end index:", s2)
```

**Output:**

```
positive start index, negative end index: come to
negative start index, positive end index: come to
```

Check this String Slicing in Python [article on Scaler Topics](https://www.scaler.com/topics/python/string-slicing-in-python/).
