Python program to display a substring from a string | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Python program to display a substring from a string

13th Sep 2019, 4:30 PM
~taufi~
~taufi~ - avatar
2 Answers
+ 2
string[start: end: step] Example: string = "freeCodeCamp" print(string[0:5]) Output: freeC
13th Sep 2019, 4:51 PM
KfirWe
KfirWe - avatar
+ 1
Thank you
13th Sep 2019, 4:55 PM
~taufi~
~taufi~ - avatar