google.com, pub-7659628848972808, DIRECT, f08c47fec0942fa0 Pro Learner: How to check if string ends with one of the strings from a list in pyhon..

Please click on ads

Please click on ads

Wednesday 3 March 2021

How to check if string ends with one of the strings from a list in pyhon..

 


string = 'elephant'
print(string.endswith(('txt', 'cat', 'java','ant', 'orld')))

No comments:

Post a Comment