NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

import datetime
#General ifelse AI to know worldclock in real time
while (True):
## get the name of the city from the user
city = input("Enter city: ")

## get the current time
current_time = datetime.datetime.now()

## save hours, minutes and second of the current time
## in their corresponding variables
hour = current_time.hour
minute = current_time.minute
second = current_time.second

## check for case 1: the learner has typed Boston
if city == "Boston":
hour = hour - 4
minute = minute + 30

## check for case 2: the learner has typed Tokyo
elif city == "Tokyo":
hour = hour + 9
elif city == "Nepal":
hour = hour + 10
elif city == "India":
hour = hour + 11
elif city == "Japan":
hour = hour + 12

## check for case 3: the learner has typed Chicago
elif city == "Chicago":
hour = hour - 5

## check for case 4: the learner has typed Seattle
elif city == "Seattle":
hour = hour - 7
elif city == "Kolkata":
hour = hour - 2
elif city == "Kolkata":
hour = hour + 5
minutes = minutes + 30

elif city == "Karachi":
hour = hour + 5

elif city == "Cairo":
hour = hour + 2

elif city == "Shanghai":
hour = hour + 8

## check for case 5: the learner has typed exit
elif city == "exit":
break

## if all cases fail, show the time for GMT
else:
print(city, "is not added")
city = "GMT"

# print the name of the city and the its corresponding time
print(city, str(hour) + ":" + str(minute) + ":" + str(second))



Second Program for AI calculator
from chatterbot import ChatBot

# naming the ChatBot calculator
# using mathematical evaluation logic
# the calculator AI will not learn with the user input
Bot = ChatBot(name = 'Calculator',
read_only = True,
logic_adapters = ["chatterbot.logic.MathematicalEvaluation"],
storage_adapter = "chatterbot.storage.SQLStorageAdapter")


# clear the screen and start the calculator
print('33c')
print("Hello, I am a calculator. How may I help you?")
while (True):
# take the input from the user
user_input = input("me: ")

# check if the user has typed quit to exit the prgram
if user_input.lower() == 'quit':
print("Exiting")
break

# otherwise, evaluate the user input
# print invalid input if the AI is unable to comprehend the input
try:
response = Bot.get_response(user_input)
print("Calculator:", response)
except:
print("Calculator: Please enter valid input.")


3rd program

from functions import *

# create chatbot
bot = create_bot('Jordan')

# train all data
train_all_data(bot)

# train chatbot with your custom data
house_owner = [
"Who is the owner of the house?",
"Mark Nicholas"
]
custom_train(bot, house_owner)
identity = input("Who is this? ")
if identity.lower() == 'Mark':
print("Welcome, Mark. Happy to have you at home")
elif identiry.lower() == 'Marry':
print("Mark is out right now, but you are welcome to this house")
elif identity.lower() == 'quit':
break

custom_train(bot, house_manager)
custom_train(bot, house_enter)

# start chatbot
start_chatbot(bot)
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.