Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python extract string

# string [start:end:step]
string = "freeCodeCamp"
print(string[0:len(string)-1])		# freeCodeCam
print(string[0:5])		            # freeC
print(string[2:6])		            # eeCo
print(string[-1])		            # p
print(string[-5:])		            # eCamp
print(string[1:-4])                 # reeCode
print(string[-5:-2])	            # eCa
print(string[::2])		            # feCdCm
Comment

PREVIOUS NEXT
Code Example
Python :: python string cut to length 
Python :: download pytz python 
Python :: check if queryset is empty django template 
Python :: live server python 
Python :: how to convert tuple into list in python 
Python :: login required django 
Python :: pytorch older versions 
Python :: addition of matrix in python using numpy 
Python :: how to run shell command ctrl + c in python script 
Python :: ordered dictionary 
Python :: What is the use of f in python? 
Python :: flask flash 
Python :: how to join two dataframe in pandas based on two column 
Python :: python file write 
Python :: py -m pip 
Python :: convert a text file data to dataframe in python without pandas 
Python :: tkinter responsive gui 
Python :: how to update values in tkinter 
Python :: pandas separator are multiple spaces 
Python :: how to add python interpreter in vscode 
Python :: anagram python 
Python :: create django project 
Python :: Set value for particular cell in pandas DataFrame using index 
Python :: python new date 
Python :: rename keys in dictionary python 
Python :: python urlparse get domain 
Python :: write in entry() in tkinter 
Python :: group by 2 columns pandas 
Python :: distance matrix gogle map python 
Python :: python constant 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =