Course
Simulator
More
Premium
Log in
Python Function Reference
Functions
startswith
startswith
Return True if the string starts with the prefix, otherwise return False.
Python 3.13
1
str
.
startswith
(
prefix
[
,
start
[
,
end
]
]
)
prefix
The prefix to check for.
start
The starting position for the check.
end
The ending position for the check.
Examples
Python 3.13
1
'hello'
.
startswith
(
'he'
)
True