30-days-of-python_Day 8

This lecture is talking about the Class detail and application.

especially arguments.

If you use a function, you can add different argument.

keyword Arguments and Positional Arguments.

I think that is different writing style.

def some_func(arg_1,arg_2,arg_3,Kwarg_1=None):
 pass(you can choose return or pass)

#arg = Positional Arguments

#kwarg = Keyword Argumentabc = “new string”

def some_func(arg_1, arg_2, kwarg_1=None, kwarg_2=None):

print(arg_1, arg_2) if kwarg_1 != None: print(kwarg_1)

#return arg_1

If you maintain the code, you can easily refer the location which the argument should change and operate.

@property
def make_noise(self):
 return self.noise

dog.make_noise

I can use the property to call the function without ().

Like what you read? Give Jeff Cheng a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.