Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created June 28, 2020 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IndhumathyChelliah/6f60e3ae249f88253969f236e038f69c to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/6f60e3ae249f88253969f236e038f69c to your computer and use it in GitHub Desktop.
s1="example of strings"
#starting and ending index is not given.
print (s1.startswith("ex"))#Output:True
#starts searching from index 5.
print (s1.startswith("le",5,20))#Output:True
#suffix can be tuple of suffixes also.
print (s1.startswith(("example","of")))#Output:True
print (s1.startswith("example of"))#Output:True
print (s1.startswith("hello"))#Output:False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment