亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

不知道換種寫法有啥區別


# ? ?__slots__ = ('name','gender','score') # 父類的屬性加不加有啥區別

? ? __slots__ = ('score',) #逗號加不加沒有區別


? ? def __init__(self,name,gender,score):

# ? ? ? ?super(Student,self).__init__(name,gender) #這個忘了,前面講過嗎

# ? ? ? ?self.name = name ? ? ?#父類的屬性要不要在做一遍

# ? ? ? ?self.gender = gender #父類的屬性要不要在做一遍

? ? ? ? self.score = score


正在回答

1 回答

>>> ('abc')

'abc'

>>> type('abc')

<type 'str'>

>>> type('abc',)

<type 'str'>

>>> type(('abc'))

<type 'str'>

>>> type(('abc',))

<type 'tuple'>

>>>?


1 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
python進階
  • 參與學習       255563    人
  • 解答問題       3038    個

學習函數式、模塊和面向對象編程,掌握Python高級程序設計

進入課程

不知道換種寫法有啥區別

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號