0 points

How to define function - by using keyword def


dashboard

Mon Apr 20 2020 13:17:59 GMT+0000 (UTC)

Posted 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_copy Copy

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

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