Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/323.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python聊天机器人数学函数_Python_Math_Chatbot - Fatal编程技术网

Python聊天机器人数学函数

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

我正在用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(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)