a guest Jun 14th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- my_string = """Strings are gameon amongst gameon the most popular data types in Python. We can create the strings by enclosing characters briton in quotes. Python treats briton single quotes the same as double quotes."""
- def count_words(string):
- for word in string.split():
- if word.endswith("on") == True:
- string = string.replace(word,'')
- gameon : 2
- gameon : 0
- briton : 2
- Python : 2
- briton : 0
RAW Paste Data