python错误 __str__() Takes 0 positional arguments but 1 was given
扔个三星炸死你
扔个三星炸死你 2017-06-15 09:22:17
0
1
1818
# -*- coding:gb2312 -*-
class car:
    # 属性
    
    # 方法
    def __str__():
        print("哈哈哈哈哈哈啊哈")
    
    def move():
        print("车在移动。")
    def Whistle():
        print("车载鸣笛。")

BMW = car()

print(BMW)

Error message:

Google translated it and said that it takes 0 position parameters, but it gave 1
I don’t understand what this means.

扔个三星炸死你
扔个三星炸死你

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!