Advertisement
ganiyuisholaafeez

String methods

Feb 20th, 2020
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. """ This is function named string_theory with a string argument that test
  2. if the argument starts with letter S and has more than 3 characters"""
  3.  
  4. def string_theory(string):
  5.  
  6. # The block to test the conditions
  7.     if len(string) > 3 and string.startswith("S"):
  8.         return True
  9.     else:
  10.         return False
  11.        
  12. # Function Invokation
  13. print(string_theory("Sansa"))
  14. print(string_theory("Story"))
  15. print(string_theory("See"))
  16. print(string_theory("Fable"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement