Monday, April 21, 2014

Day 16

Explored some Python at Gork Learning, wrote a program in which bot asks are we there yet, then reacts based on your comment.

The code I used:
# Code for "Interacting with bot."
answer = "no"
while answer != "yes":
  print("Are we there yet?")
  answer = input()
print("Yes! We are finally here.")

The interaction looked like this:
Are we there yet?
no
Are we there yet?
no
Are we there yet?
yes
Yes! We are finally here.

No comments:

Post a Comment