in ,

“Python is easy” they say

Python is easy meme

class Fruit:

def

init_ (self, data = {‘color’: ‘unknown’ }) :

self._data = data

def set_color(self, color: str):

self._data[“color”] = color

def print_data(self) :

print(f”I’m {self._data.get (‘color’ )}.”)

orange = Fruit()

orange. set_color (“orange”)

orange.print_data()

Python:

I’m orange.

apple = Fruit()

apple.print_data()

I’m orange

Python:

THIS IS FINe.

What do you think?

Written by codeitbro

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings