How to define function - by using keyword def

PHOTO EMBED

Mon Apr 20 2020 13:17:59 GMT+0000 (Coordinated Universal Time)

Saved by @fruityuser #python #function #python #def

 # give a name of function after def
 1.def sayhi():
      #put the statement in the function  
     2.print(“hello world”)
#call function by name:
3.sayhi()


Output: 
Hello world
content_copyCOPY

def is a keyword that tells python that user want to make a function.

https://www.youtube.com/watch?v=rfscVS0vtbw&t=5s