Lesson 59
This commit is contained in:
parent
197a64869d
commit
64b582fa6f
25
basics.py
25
basics.py
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user