Advertisement
matthewdeanmartin

ask_jeeves.py

Dec 4th, 2022
936
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. # Import the random module
  2. import random
  3.  
  4. # Define a list of responses
  5. responses = [
  6.   "I'm sorry, I cannot answer that.",
  7.   "I think that is a very good question.",
  8.   "I'm not sure, but I'll try to find out.",
  9.   "That is a difficult question. Let me think about it.",
  10.   "I don't know the answer to that. Can you please provide more information?",
  11.   "I'm sorry, but I am not programmed to provide that information.",
  12.   "I'm not sure, but I'll try my best to help you.",
  13.   "I'm sorry, but I am not capable of answering that question.",
  14. ]
  15.  
  16. # Game loop
  17. while True:
  18.   # Get the player's question
  19.   question = input("Ask Jeeves: ")
  20.  
  21.   # Choose a random response from the list
  22.   response = random.choice(responses)
  23.  
  24.   # Print the response
  25.   print("Jeeves: {}".format(response))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement