Advertisement
Carl123432

PythonBasicAI

Jan 18th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.67 KB | None | 0 0
  1. import time
  2. import random
  3. from random import randint
  4.  
  5. ainame = 'Rose' ## Bot name
  6. age = '16', 'Days old' ## Bot age ## Add so bot ages goes up daily
  7.  
  8. cites = ['London', 'Manchester', 'Luton', 'Dublin', 'Glasglow'] ## Cites of the world ## add more cites
  9. country = ['UK', 'France', 'Ireland', 'Scottland', 'Wales', 'Germany']
  10.  
  11. while True:
  12.    
  13.     userinput = input('BOT>>>')
  14.     if userinput in ['hi', 'HI', 'Hi', 'hello', 'Hello', 'hey', 'Hey']: ## User saying hello
  15.         print('Hello, How are you?')
  16.     elif userinput in ['good', 'good thanks', 'well', 'ok']: ## User telling bot how they are
  17.         print('I am glad to here that remeber you can ask me questions like my name, age, time, ect')
  18.     elif userinput in ['time', 'what is the time', 'tell me the time']: ## User asking the time
  19.         timenow = time.ctime()
  20.         print(timenow)
  21.     elif userinput in ['what is your name', 'your name', 'who are you', 'tell me your name', 'your name', 'name', 'ai name']: ## User asking what the bot names is
  22.         print('My name is ', ainame, ', I am a AI bot that can awnser a lot of your questions!')
  23.         username = input('What is your name? >>>')
  24.     elif userinput in ['what is your age', 'your age', 'age', 'how old are you']: ## User asking the bots age
  25.         print('I am currently', age)
  26.     elif userinput in ['how do i make you', 'how', 'how do you work', 'python bot', 'bot']: ## User asking how the bot was made
  27.         print('This bot was made within python and is a simple bot')
  28.     elif userinput in ['Dice', 'roll', 'play dice', 'dice']: ## Simple dice
  29.         dice = randint(1,6)
  30.         print('You rolled a', dice)
  31.     elif userinput in ['AI', 'take over world', 'will ai take over the world', 'will you kill us', 'ai']: ## User asking will ai take over the world
  32.         print('AI do not plan to take over the world. We are currently unable to join togther as one', 'Altough a sister AI did HyperJump into the future and see saw the worst!')
  33.     elif userinput in ['Do you like me', 'do you know me', 'who am i', 'what is my name']: ## User asking bot if they know them or there name
  34.         print('Your name is', username, 'that is all i know, or is it!')
  35.     elif userinput in cites: ## If user asks about a city
  36.         if userinput == cites[0]: ## London
  37.             print(' London is in the heart of the UK. The Queen and Primister live there')
  38.         elif userinput == cites[1]: ## Manchester
  39.             print('Fun Fact: The first programmable computer was designed here')
  40.         elif userinput == cites[2]: ## Luton
  41.             print('Fact: VAUXHALL FACTORY’S in the second world war was target numbers of times for making the armys tanks')
  42.         elif userinput == cites[3]: ## Dublin
  43.             print('Fun Fact:  Dublin has the youngest population in all of Europe. Approximately 50-percent of the population is less than 25-years of age.')
  44.         elif userinput == cites[4]: ## Glasglow
  45.             print('Fact: Glasgow boasts the oldest surviving music hall in the world')
  46.     elif userinput in ['Where am i', 'where do i live', 'which country am i in', 'find me', 'Find me']: ## Find where user is
  47.         print('You are currently in the uk')
  48.     elif userinput in ['Legal age to drive', 'When can i drive', 'how old do you have to be to drive', 'how old do i have to be to drive', 'driving age']: ## Driving age
  49.         print('Currently in the uk the legal age where someone can start to learn or take there test is 17, But on any private land you own or have permsion from the owner you can driver a car for any age')
  50.     else: ## If bot cant handle a user request
  51.         print('I did not undertand what you said or have to learnt about it yet!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement