Sei sulla pagina 1di 3

Name_____Sai Upputuru________________ 01.

05 String Input

This assignment has three parts.

Part One: Write a program to simulate a chatbot conversation. Use the following guidelines to write your
program:

1. Decide on an interactive conversation 4. At least once, use the indexing or slicing


someone could have with a computer. technique.
2. Your program should include at least 5. Use concatenation to join string literals
three interactive prompts. and string values.
3. Input from the user should be assigned 6. Write the pseudocode for this program.
to variables and used throughout the Be sure to include any input and output
conversation. needed.

Insert your pseudocode here:

Input: Ask the user for their name


Ask user for the name of an animal that starts with the letter ‘T’
Ask the user for a favorite location place
Output:
Displays a message saying hi to the user
Then it will display saying it saw that animal at the zoo
Displays a message saying it’s been there before.

Part Two: Code the program. Use the following guidelines to code your program.
1. Code the program using Python IDLE. 3. Use meaningful names for all variables.
2. Using comments, type a heading that 4. Follow the Python style conventions
includes your name, today’s date, and a regarding indentation and the use of
short description of the program. white space in your 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:

# Sai Upputuru

# 6/23/2020

# I will be coding a program that simulates a chatbox

def main():

print("Hi I am Grace!")

name = input("What is your name?")

print("Hello there, " +name+ "!")

print("The second letter of your name is " +name[1]+ ".")

print("I challenge you to name an animal that starts with the letter T.")

animalName = input("Guess the name of an animal that starts with a T")

print("Oh Wow! I once saw a " +animalName+ " at the zoo!")

print("Great guess " +name+ "!")

print("One more question! What is your favorite place to go on a vacation?")

placeName = input("Name a place that you like visiting")

print("I've been to " +placeName+ " Before!")

print("It was nice chatting with you " +name+ ". Bye!")

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 the code was to make a small interactive chatbox
program. It was also to practice my indexing and concatenation.
program?

How could your program be useful in This can teach me to how to make forms where information has
to be submitted.
the real world?

What is a problem you ran into, and Sometimes I forgot to add a space so It would combine the
output and the sentence after. I had to look at it for a while and
how did you fix it?
then I figured it out.

Describe one thing you would do Next time I write this program I would have it so there are
multiple responses to the outputs.
differently the next time you write a
program.

Potrebbero piacerti anche