Commit 0f3d5db5 by BellCodeEditor

auto save

parent 1caf2be7
Showing with 6 additions and 3 deletions
...@@ -3,11 +3,15 @@ class Fruit: ...@@ -3,11 +3,15 @@ class Fruit:
self.color=color self.color=color
self.kougan=kougan self.kougan=kougan
self.wcnm=wcnm self.wcnm=wcnm
apple=Fruit("red","3.8",4.8) def update(self):
self.wcnm=self.wcnm+2
apple=Fruit("red","7",8)
banana=Fruit("yellow","4",5) banana=Fruit("yellow","4",5)
print(apple.color) print(apple.color)
print(apple.kougan) print(apple.kougan)
print(apple.wcnm) print(apple.wcnm)
apple.update()
banana.update()
print(banana.color) print(banana.color)
print(banana.kougan) print(banana.kougan)
print(banana.wcnm) print(banana.wcnm)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment