Skip to content

Latest commit

 

History

History
8 lines (6 loc) · 210 Bytes

string-starts-with-a-list-of-strings.md

File metadata and controls

8 lines (6 loc) · 210 Bytes

String starts with a list of strings

str.startswith allows you to pass a tuple of strings to check if the string starts with any of them.

if mystr.startswith((']', ')', '}')):
    return False