summaryrefslogtreecommitdiff
path: root/comp/work/13/find_smallest.py
diff options
context:
space:
mode:
authorstandenboy <standenboy@seacrossedlovers.xyz>2023-12-15 10:19:20 +0000
committerstandenboy <standenboy@seacrossedlovers.xyz>2023-12-15 10:19:20 +0000
commit4a95719d58a708ad55b1389631d6339047f786a0 (patch)
tree26cb6fc2dbe7fa75f57f1d6fb13aff8955772b56 /comp/work/13/find_smallest.py
added existing work
Diffstat (limited to 'comp/work/13/find_smallest.py')
-rwxr-xr-xcomp/work/13/find_smallest.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/comp/work/13/find_smallest.py b/comp/work/13/find_smallest.py
new file mode 100755
index 0000000..362383a
--- /dev/null
+++ b/comp/work/13/find_smallest.py
@@ -0,0 +1,9 @@
+def find_smallest(numbers):
+ smallest = numbers[0]
+ for i in numbers:
+ if i < smallest:
+ smallest = i
+ return smallest
+
+numbers = [3, 6, 2, 8, 4, 1]
+print(find_smallest(numbers))