diff --git a/basics.py b/basics.py index acdfd99..e39230f 100644 --- a/basics.py +++ b/basics.py @@ -1,7 +1,18 @@ -output = "" -something = "" -while something != "\end": - something = input("Say something: ") - if something != "\end": - output = output + something + ". " -print(output) \ No newline at end of file +def sentence_maker(phrase): + interrogatives = ("how", "what", "why") + capitalized = phrase.capitalize() + if phrase.startswith(interrogatives): + return "{}?".format(capitalized) + else: + return "{}.".format(capitalized) + +results = [] +while True: + user_input = input("Say something: ") + if user_input == "\end": + break + else: + results.append(sentence_maker(user_input)) + +print(" ".join(results)) + \ No newline at end of file