class book:
    _author=''
    _name=''
    _page=0
    price=0
    _press=''
    def _check(self,item):
        if item=='':
            return 0
        else:
            return 1

    def show(self):
        if self._check(self._author):
            print(self._author)
        else:
            print('No value')
        if self._check(self._name):
            print(self._name)
        else:
            print('No value')

    def setname(self,name):
        self._name=name
    def __init__(self,author,name):
        self._author=author
        self._name=name
       
a=book('Tom','A Wonderful Book')
a.show()

相关文章:

  • 2021-04-06
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-05
猜你喜欢
  • 2021-07-27
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2022-12-23
  • 2021-11-25
相关资源
相似解决方案