Programming
Python
R
Java
C
C++
C#
WEB
HTML
CSS
JavaScript
BootStrap4
jQuery
SVG
MORE
Examples1
Python
GO
R
Java
C
C++
C#
Examples2
Python
R
Java
C
C++
C#
HTML
CSS
JavaScript
BootStrap4
jQuery
SVG
Seo Tools
Code Minifier
Code Beautifier
Language Compiler
Misc Tools
File Converter
References
C
C++
Python
Java
PHP
JavaScript
Examples
Python
R
Java
C
C++
C#
HTML
CSS
JavaScript
BootStrap4
jQuery
SVG
Home
About
Contact
JetPack
Multi Themes-->>
Code it ALL
Scroll TOP
partition() - String in python - CodeGK
Δ Python References
Dictionary
clear
copy
get
items
keys
pop
popitem
setdefault
update
values
Functions
abs()
all()
any()
ascii()
bin()
bool()
bytearray()
bytes()
callable()
chr()
complex()
delattr()
dict()
dir()
divmod()
enumerate()
float()
frozenset()
getattr()
globals()
hasattr()
help()
hex()
input()
int()
isinstance()
issubclass()
iter()
len()
list()
locals()
max()
min()
next()
oct()
List
append()
clear()
copy()
count()
index()
insert()
pop()
remove()
reverse()
sort()
String
capitalize()
casefold()
center()
count()
encode()
endswith()
expandtabs()
find()
format()
id()
index()
isalnum()
isalpha()
isdecimal()
isdigit()
isidentifier()
islower()
isnumeric()
isprintable()
isspace()
istitle()
isupper()
join()
ljust()
lower()
lstrip()
partition()
replace()
rfind()
rindex()
rjust()
rpartition()
upper()
♦ partition() - String
♣ Example1: partition()
Input:
Run CODE
Reload Code
Copy Code
str1 = "what's uP in the sky?" str1=str1.partition("uP") print(str1) str2 = " yo folks, what is going with you folks?" str2=str2.partition("apple") print(str2) str3 = " allGoodyou" str3=str3.partition("all") print(str3) str4 = "EatPieFast314" str4=str4.partition("Pie") print(str4)
Output: