Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def words_after_g(phrase):
- word = ""
- words_after_g = []
- for char in phrase:
- if char.isalpha():
- word += char
- else:
- if word and word[0].lower() > 'g':
- words_after_g.append(word.upper())
- word = ""
- if word and word[0].lower() > 'g':
- words_after_g.append(word.upper())
- for word in words_after_g:
- print(word)
- def main():
- name = input("Welcome, [INSERT NAME]. Please enter your name: ")
- phrase = input(f"Hello, {name}. Enter a 1 sentence quote, non-alpha separate words: ")
- words_after_g(phrase)
- main()
Advertisement
Add Comment
Please, Sign In to add comment