8000 mymin.py file, with custom min function was added. · linxam/python_examples@9b0e9b9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9b0e9b9

Browse files
committed
mymin.py file, with custom min function was added.
1 parent 5d36e14 commit 9b0e9b9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mymin.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
def mymin(l):
2+
'''Custom min function. Python example/exercise.'''
3+
m = l[0]
4+
for i in l:
5+
if i<m:
6+
m = i
7+
return m
8+
9+
print(mymin([4,2,8,1]))
10+
print(mymin('asdf'))
11+
print(mymin(('asdf', 'qwer', 'zxcv')))

0 commit comments

Comments
 (0)
0