Python聊天机器人数学函数
我正在用Python制作聊天机器人。我怎样才能教我的聊天机器人为它交谈的人做数学?有没有办法让它使用Python数学函数(即3*8)?是的,做数学很容易 乘法:Python聊天机器人数学函数,python,math,chatbot,Python,Math,Chatbot,我正在用Python制作聊天机器人。我怎样才能教我的聊天机器人为它交谈的人做数学?有没有办法让它使用Python数学函数(即3*8)?是的,做数学很容易 乘法: input_0 = input("What is the first number you want to multiply") input_1 = input("What is the second number you want to multiply") answer = int(inpu
input_0 = input("What is the first number you want to multiply")
input_1 = input("What is the second number you want to multiply")
answer = int(input_0) * int(input_1)
print(answer)
input_0 = input("What is the first number you want to divide")
input_1 = input("What is the second number you want to divide")
answer = int(input_0) / int(input_1)
print(answer)
input_0 = input("What is the first number you want to add")
input_1 = input("What is the second number you want to add")
answer = int(input_0) + int(input_1)
print(answer)
input_0 = input("What is the first number you want to subtract")
input_1 = input("What is the second number you want to subtract")
answer = int(input_0) - int(input_1)
print(answer)
分部:
input_0 = input("What is the first number you want to multiply")
input_1 = input("What is the second number you want to multiply")
answer = int(input_0) * int(input_1)
print(answer)
input_0 = input("What is the first number you want to divide")
input_1 = input("What is the second number you want to divide")
answer = int(input_0) / int(input_1)
print(answer)
input_0 = input("What is the first number you want to add")
input_1 = input("What is the second number you want to add")
answer = int(input_0) + int(input_1)
print(answer)
input_0 = input("What is the first number you want to subtract")
input_1 = input("What is the second number you want to subtract")
answer = int(input_0) - int(input_1)
print(answer)
添加:
input_0 = input("What is the first number you want to multiply")
input_1 = input("What is the second number you want to multiply")
answer = int(input_0) * int(input_1)
print(answer)
input_0 = input("What is the first number you want to divide")
input_1 = input("What is the second number you want to divide")
answer = int(input_0) / int(input_1)
print(answer)
input_0 = input("What is the first number you want to add")
input_1 = input("What is the second number you want to add")
answer = int(input_0) + int(input_1)
print(answer)
input_0 = input("What is the first number you want to subtract")
input_1 = input("What is the second number you want to subtract")
answer = int(input_0) - int(input_1)
print(answer)
减法:
input_0 = input("What is the first number you want to multiply")
input_1 = input("What is the second number you want to multiply")
answer = int(input_0) * int(input_1)
print(answer)
input_0 = input("What is the first number you want to divide")
input_1 = input("What is the second number you want to divide")
answer = int(input_0) / int(input_1)
print(answer)
input_0 = input("What is the first number you want to add")
input_1 = input("What is the second number you want to add")
answer = int(input_0) + int(input_1)
print(answer)
input_0 = input("What is the first number you want to subtract")
input_1 = input("What is the second number you want to subtract")
answer = int(input_0) - int(input_1)
print(answer)
是的,做数学很容易 乘法:
input_0 = input("What is the first number you want to multiply")
input_1 = input("What is the second number you want to multiply")
answer = int(input_0) * int(input_1)
print(answer)
input_0 = input("What is the first number you want to divide")
input_1 = input("What is the second number you want to divide")
answer = int(input_0) / int(input_1)
print(answer)
input_0 = input("What is the first number you want to add")
input_1 = input("What is the second number you want to add")
answer = int(input_0) + int(input_1)
print(answer)
input_0 = input("What is the first number you want to subtract")
input_1 = input("What is the second number you want to subtract")
answer = int(input_0) - int(input_1)
print(answer)
分部:
input_0 = input("What is the first number you want to multiply")
input_1 = input("What is the second number you want to multiply")
answer = int(input_0) * int(input_1)
print(answer)
input_0 = input("What is the first number you want to divide")
input_1 = input("What is the second number you want to divide")
answer = int(input_0) / int(input_1)
print(answer)
input_0 = input("What is the first number you want to add")
input_1 = input("What is the second number you want to add")
answer = int(input_0) + int(input_1)
print(answer)
input_0 = input("What is the first number you want to subtract")
input_1 = input("What is the second number you want to subtract")
answer = int(input_0) - int(input_1)
print(answer)
添加:
input_0 = input("What is the first number you want to multiply")
input_1 = input("What is the second number you want to multiply")
answer = int(input_0) * int(input_1)
print(answer)
input_0 = input("What is the first number you want to divide")
input_1 = input("What is the second number you want to divide")
answer = int(input_0) / int(input_1)
print(answer)
input_0 = input("What is the first number you want to add")
input_1 = input("What is the second number you want to add")
answer = int(input_0) + int(input_1)
print(answer)
input_0 = input("What is the first number you want to subtract")
input_1 = input("What is the second number you want to subtract")
answer = int(input_0) - int(input_1)
print(answer)
减法:
input_0 = input("What is the first number you want to multiply")
input_1 = input("What is the second number you want to multiply")
answer = int(input_0) * int(input_1)
print(answer)
input_0 = input("What is the first number you want to divide")
input_1 = input("What is the second number you want to divide")
answer = int(input_0) / int(input_1)
print(answer)
input_0 = input("What is the first number you want to add")
input_1 = input("What is the second number you want to add")
answer = int(input_0) + int(input_1)
print(answer)
input_0 = input("What is the first number you want to subtract")
input_1 = input("What is the second number you want to subtract")
answer = int(input_0) - int(input_1)
print(answer)