Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use one line of code to search for multiple suffixes of a string in python

Shulou Source: shulou.com Published: 2022-06-01 04:52:05 10月26日 Update

This article mainly shows you "python how to use a line of code to search for multiple suffixes of a string", the content is easy to understand, well-organized, hope to help you solve your doubts, the following let the editor lead you to study and learn "python how to use a line of code to search multiple suffixes of a string" this article.

One line of code searches for multiple suffixes of a string

Print ("http://www.google.com".startswith(("http://","https://")))print("http://www.google.co.uk".endswith((".com",".co.uk")))#1-> True#2- > True" is all the content of the article "how to search for multiple suffixes of a string in python with one line of code". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Line code suffix multiple characters strings search content articles learning help easy to understand more organization knowledge editing industry information information channels channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft NVidia MariaDB Shulou Technology OPPO Reno