-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArguments.py
More file actions
50 lines (30 loc) · 868 Bytes
/
Copy pathArguments.py
File metadata and controls
50 lines (30 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Return Arguments
m = [9,10,11,21,50]
def modify(k):
m.append(k)
print("k = ", k)
modify(10)
# Return statements with
def replace(f):
return f
c=0
c is replace(5)
print("This is the value of c ", c)
# Function arguments with default parameters
def makeBanner(message,banner="User"):
print(message + banner)
# Calling a default parameter function using one parameter.
makeBanner("Welcome ")
#Calling a default parameter function using second parameter.
makeBanner("Welcome ","Sraavan")
class PersonA():
def printSomething():
print("Printing Something!")
def printHelloWorld():
print("Printing Hello World")
class PersonB():
def printSomething():
print("Printing something")
def printHelloWorld():
print("Printing Hello World")
PersonA().printHelloWorld