- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunction1.py
More file actions
Latest commit
21 lines (18 loc) · 508 Bytes
/
Copy pathfunction1.py
File metadata and controls
21 lines (18 loc) · 508 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 20 10:44:25 2017
@author: root
"""
total=0; # This is global variable.
# Function definition is here
defsum( num1, num2 ):
# Add both the parameters and return them."
num1=12
num2=23
total=num1+num2; # Here total is local variable.
print ("Inside the function local total : ", total)
returntotal;
# Now you can call sum function
total=sum( 10, 20 );
print ("Outside the function global total : ", total )