python火影代码
时间: 2023-11-08 18:04:58 浏览: 164
python代码
以下是一个简单的 Python 火影代码:
```python
class Ninja:
def __init__(self, name, chakra):
self.name = name
self.chakra = chakra
class Uzumaki(Ninja):
def __init__(self, name, chakra, clan):
super().__init__(name, chakra)
self.clan = clan
class Uchiha(Ninja):
def __init__(self, name, chakra, sharingan):
super().__init__(name, chakra)
self.sharingan = sharingan
naruto = Uzumaki("Naruto Uzumaki", 100, "Uzumaki Clan")
sasuke = Uchiha("Sasuke Uchiha", 100, True)
print(naruto.name)
print(sasuke.name)
```
输出:
```
Naruto Uzumaki
Sasuke Uchiha
```
阅读全文