Discuss / Python / Answer

Answer

Topic source

ForeverFerret

#1 Created at ... [Delete] [Delete and Lock User]
class Screen:
    @property
    def resolution(self):
        return self.width * self.height

394188066

#2 Created at ... [Delete] [Delete and Lock User]

你这个虽然能通过测试,只能说这个测试不严谨,太生草了

ForeverFerret

#3 Created at ... [Delete] [Delete and Lock User]

或许, 并没有你想的那样复杂

よろしく

#4 Created at ... [Delete] [Delete and Lock User]

正解,如果没有额外的逻辑和限制,get/set方法就没有存在的必要

庆哥哥

#5 Created at ... [Delete] [Delete and Lock User]

return 786432

这样更简洁


  • 1

Reply