Crossin的编程教室
标题:
额
[打印本页]
作者:
lizimeili
时间:
2024-4-16 20:35
标题:
额
程序:
def snake(n1,p,n2):
n1 = int(n1)
if p == "+":
n2 = int(n2)
print(n1+n2)
elif p == "-":
n2 = int(n2)
end = n1-n2
elif p == "*":
n2 = int(n2)
end = n1*n2
elif p == "/":
n2 = int(n2)
end = n1/n2
return end
错误:
snake(1,+,1)
SyntaxError: invalid syntax
作者:
crossin先生
时间:
2024-4-17 02:33
snake(1,'+',1)
欢迎光临 Crossin的编程教室 (https://bbs.crossincode.com/)
Powered by Discuz! X2.5