-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.py
More file actions
123 lines (78 loc) · 2.09 KB
/
Copy pathfunction.py
File metadata and controls
123 lines (78 loc) · 2.09 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# def my_function():
# print("Hello from a function")
# def my_function():
# print("Hello from a function")
# my_function()
# def my_function(fname):
# print(fname + " Shams")
# my_function("Maheen")
# my_function("Tobias")
# my_function("Linus")
# def my_function(fname, lname):
# print(fname + " " + lname)
# my_function("Maheen", "Shams")
# def my_function(fname, lname):
# print(fname + " " + lname)
# my_function("Emil")
# def my_function(*kids):
# print("The youngest child is " + kids[2])
# my_function("Emil", "Tobias", "Linus")
# def my_function(child3, child2, child1):
# print("The youngest child is " + child3)
# my_function(child1 = "Emil", child2 = "Tobias", child3 = "Linus")
# def my_function(**kid):
# print("His last name is " + kid["lname"])
# my_function(fname = "Tobias", lname = "Refsnes")
# def my_function(country = "Norway"):
# print("I am from " + country)
# my_function("Sweden")
# my_function("India")
# my_function()
# my_function("Italy")
# def my_function(food):
# for x in food:
# print(x)
# fruits = ["apple", "banana", "cherry"]
# my_function(fruits)
# def my_function(x):
# return 5 * x
# print(my_function(3))
# print(my_function(5))
# print(my_function(9))
# def myfunction():
# pass
# def my_function(x, /):
# print(x)
# my_function(3)
# def my_function(x):
# print(x)
# my_function(x = 3)
# def my_function(*, x):
# print(x)
# my_function(x = 3)
# def my_function(x):
# print(x)
# my_function(3)
# def my_function(a, b, /, *, c, d):
# print(a + b + c + d)
# my_function(5, 6, c = 7, d = 8)
# def tri_recursion(k):
# if(k > 0):
# result = k + tri_recursion(k - 1)
# print(result)
# else:
# result = 0
# return result
# print("Recursion Example Results:")
# tri_recursion(6)
def average(*numbers):
print(type(numbers))
sum = 0
for i in numbers:
sum = sum + i
print("Average of numbers is ", sum/len(numbers))
average(1,2,3,4,5)
def name(**name):
print(type(name))
print("Hello! My name is", name["fname"], name["mname"], name["lname"])
name(fname="Md", mname = "Shamserul", lname = "Haque")