Sunday, April 20, 2014

Day 15

Explored some Python at Gork Learning, wrote a program in which bot asks how are you feeling, then reacts based on your comment.

The code I used:
# Code for "Interacting with bot."
print("How are you feeling today?")
feeling = input()
if feeling == "Good":
  print("That's good.")
elif feeling == "Awesome":
  print("You are awesome!")
elif feeling == "Sad":
  print("Maybe I can help?")
else:
  print("I'm sorry you feel like that.")

The interaction looked like this:
How are you feeling today?
sad
I'm sorry you feel like that

No comments:

Post a Comment