print("Entre nummber 1: ") num1 = float(input('> ')) print("Entre opperation: ") op = input('> ') print("Entre nummber 2: ") num2 = float(input('> ')) result = print("Your Result is:") if op == "+": print(num1 + num2) print(result) print("Done") elif op == '-': print(num1 - num2) print(result) print("Done") elif op == '/': print(num1 / num2) print(result) print("Done") elif op == '*': print(num1 * num2) print(result) print("Done") elif op == '**': print(num1 ** num2) print(result) print("Done") else: print("Entre a valid opperation")
我试图制作一个计算器,但可以正常工作,但最后无故弹出“ none”我不知道为什么要感谢您的帮助
print(“ Entre nummber 1:”)num1 = float(input('>'))print(“ Entre opperation:”)op = input('>')print(“ Entre nummber 2:”)num2 = float (input('>'))result = print(“您的结果是:”)如果op ...
result = print("Your Result is:")
result = print("Your Result is:")
# remove result = print("Your result is :")
# Add this result = num1 'operation +/-/*/** etc' num2 after your if condittions.
# for example :
if op == "+":
result = num1 + num2
print("Your result is :",result)
if op == "-" :
result = num1 - num2
print("Your result is :",result)
# It will work fine.