Commit aae82f3e by BellCodeEditor

save project

parent 6a61d2b5
Showing with 10 additions and 5 deletions
class Fruit: class Fruit:
def __init__(self): def __init__(self,color,kougan,wcnm):
self.color="red" self.color=color
self.kougan="3.8" self.kougan=kougan
self.wcnm="4.8" self.wcnm=wcnm
apple=Fruit() apple=Fruit("red","3.8",4.8)
banana=Fruit("yellow","4",5)
print(apple.color) print(apple.color)
print(apple.kougan) print(apple.kougan)
print(apple.wcnm) print(apple.wcnm)
print(banana.color)
print(banana.kougan)
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