Post

PythonPython

i
irfan mohammad

Posted on 27th February 2024|29 views

0
votes

How Do I Get A Substring In Python?

What is the process of getting a substring in python

Answers
P
jordan chris

Posted on 27th February 2024

I can explain to you by using the below example:

  nin_string = 'xbzefdgstb'

  print ("the initial_string : ", nin_string)

  sstring = nin_string[2:7:2]

  print ("the resultant substring", sstring)

 

Output:

the initial_strings : xbzefdgstb

the resultant substring zfg

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo
  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos