我想检查一个数字是否是秒的倍数.以下代码有什么问题?
def is_multiple(x,y):
if x!=0 & (y%x)==0 :
print("true")
else:
print("false")
end
print("A program in python")
x=input("enter a number :")
y=input("enter its multiple :")
is_multiple(x,y)
Run Code Online (Sandbox Code Playgroud)
错误:
TypeError: not all arguments converted during string formatting
Run Code Online (Sandbox Code Playgroud) 我不理解Python教程中的以下句子:
从它的方法引用对象的成员没有简写方法.方法函数使用表示对象的显式第一个参数声明,该参数由调用隐式提供.
这是否意味着,在类的每个方法中,其对象都与数据成员一起隐藏?这可以用示例代码解释吗?