
Python 入門指南 5.0
exercise2405.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # 從 exercise2304 引入 GuessUser from exercise2304 import GuessUser # 定義猜數字遊戲類別 class GuessGame: def __init__(self, name): # 儲存玩家的屬性 self.player = GuessUser(name) # 執行部分 if __name__ == '__main__': g = GuessGame("小明") print(g.player.name) # 檔名: exercise2405.py # 說明:《Python入門指南》的練習 # 網站: http://kaiching.org # 作者: 張凱慶 # 時間: 2023 年 10 月 |
