String Input (1)
String Input (1)
05 String Input
Part One: Write a program to simulate a chatbot conversation. Use the following guidelines to write your
program:
Input: Ask the user what their name is. Ask the user what their favorite sport is. Ask the user what the
third letter of their favorite sport is. Ask the user what other sport starts with that letter.
Output:
Tell the user my name; tell the user my favorite sport and third letter of my favorite sport. Tell the user
what other sport starts with that letter and tell them their answers to all of the questions.
Part Two: Code the program. Use the following guidelines to code your program.
1. Code the program using Python 3. Use meaningful names for all
IDLE. variables.
2. Using comments, type a 4. Follow the Python style
heading that includes your name, conventions regarding indentation and
today’s date, and a short description of the use of white space in your program.
the program.
Example of expected output: The output for your program should resemble the following screen shot.
Your specific results will vary depending on the choices you make about the conversation and the input
provided.
Insert a copy of your code from the IDLE here:
# Paromita Tiwari
# 11/7/2019
def main():
print("A sport that starts with 'n' is Novuss, the national sport of Latvia.")
print("You said " + thirdLetter + " as the third letter of your favorite sport.")
otherSport = input("What other sport starts with the third letter of your favorite sport?")
print("You said " + otherSport + " starts with the third letter of your favorite sport.")
main()
Part Three: Complete the Post Mortem Review (PMR). Write thoughtful two to three sentence responses
to all the questions in the PMR chart.
Review Question Response
What was the purpose of your The purpose of my program was to create a program resembling
program? a chatbot that someone could talk with. The ultimate goal was to
entertain the user.
How could your program be useful in It is useful in the real world to entertain someone with the
the real world? program. If someone feels alone, something like this could help
them feel like they are actually talking to someone.
What is a problem you ran into, and A problem I ran into was that I was unable to figure out how to
how did you fix it? add spaces in between concatenated variables so when I ran the
program, the result would be words mashed together. I figured
out that you have to add spaces in the quotations before and
after the added variable to make sure it shows up as a single
word.
Describe one thing you would do I will be careful to place my spaces correctly. I will also make sure
differently the next time you write a I have two sets of quotations for every string literal so I don’t
program. receive any errors.