Lesson 59

This commit is contained in:
David Avery 2020-01-29 13:54:51 +00:00
parent 197a64869d
commit 64b582fa6f

View File

@ -1,7 +1,18 @@
output = "" def sentence_maker(phrase):
something = "" interrogatives = ("how", "what", "why")
while something != "\end": capitalized = phrase.capitalize()
something = input("Say something: ") if phrase.startswith(interrogatives):
if something != "\end": return "{}?".format(capitalized)
output = output + something + ". " else:
print(output) 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))