+ 3

Guys vou can give me a example of "def" function?

Plz i dont understand:( he means a print?

27th Dec 2020, 12:46 PM
Andrea Barreto
Andrea Barreto - avatar
2 Antworten
+ 4
def is just used to "define" or create a function. Let's say i want to make a function called: say_hi, and have it print a hello message. def say_hi(): print("Hello!") Now when you call say_hi(), the interpreter will print: Hello!
27th Dec 2020, 12:48 PM
Slick
Slick - avatar
+ 4
def can also be used in decor..
27th Dec 2020, 1:24 PM
VṢtēphen
VṢtēphen - avatar