Blog Introductions
In this blog contains tutorials about HTML Tutorials, Python Tutorials, CSS Tutorials, How to, PHP Tutorials, Java Tutorials, C++ Tutorials, Tutorials, Examples, Source code,Learning,
Tips and Software development services.Python Functions and Passing parameter to function | Python tutorials Bestitworriors
Python Functions and Passing parameter to function
Python Functions and Passing parameter to function | Python tutorials Bestitworriors - A block of code written in side the function.Functon can use many time in the code for many purposes.Function don't execute untill call the function by its name . Python function start with def function_name()//code .
Some Key Points of Python Functions
- Function Contain a block of code
- Function don't start work untill call them with function name
- You can send one ore multiple parameter to the functions
- Function also return value
- Function use for multipurpose
Code
def first_Function():
print("Best it worrior is best platform")
first_Function()
def Print_Names(fname):
print(fname + " ")
Print_Names("Best")
Print_Names("It")
Print_Names("Worrior")
def Multi_Parameter(fname, lname):
print(fname + " " + lname)
Multi_Parameter("Best It", " Worriors")
def Print_months(months):
for x in months:
print(x)
month = ["Januarry", "Feburary", "March", "April", "May", "June", "July"]
Print_months(month)
def Return_Function(x):
return 5 * x
print(Return_Function(3))
print(Return_Function(5))
print(Return_Function(9))
OutPut
Best it worrior is best platform
Best
It
Worrior
Best It Worriors
Januarry
Feburary
March
April
May
June
July
15
25
45
Best
It
Worrior
Best It Worriors
Januarry
Feburary
March
April
May
June
July
15
25
45
0 Comments