0% found this document useful (0 votes)
8 views1 page

Python Function Examples and Outputs

The document provides examples of Python functions that demonstrate variable manipulation and output. It includes a function 'demo' that prints a name and age, a function 'change' that modifies a string and prints it, and a function 'process' that alters a value and returns a result. Each function is called with specific arguments to illustrate their behavior.

Uploaded by

jesal.jani
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

Python Function Examples and Outputs

The document provides examples of Python functions that demonstrate variable manipulation and output. It includes a function 'demo' that prints a name and age, a function 'change' that modifies a string and prints it, and a function 'process' that alters a value and returns a result. Each function is called with specific arguments to illustrate their behavior.

Uploaded by

jesal.jani
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.

Write a program to create a function that takes two arguments, name and age, and print their
value.

# demo is the function name Output :

def demo(name, age): Ben 25

# print value

print(name, age)

# call function

demo("Ben", 25)

Output:

S="welcome" HELLO@wlcome

def change(T):

T="HELLO"

print(T,end='@')

change(S)

print(S)

def process(x): output

x=72 75

return x+3;

y=0

res=process(y)

print(res)

You might also like