From 4a95719d58a708ad55b1389631d6339047f786a0 Mon Sep 17 00:00:00 2001 From: standenboy Date: Fri, 15 Dec 2023 10:19:20 +0000 Subject: added existing work --- comp/work/13/find_smallest.py | 9 +++++++++ comp/work/13/reverse_words.py | 6 ++++++ comp/work/13/task.py | 14 ++++++++++++++ 3 files changed, 29 insertions(+) create mode 100755 comp/work/13/find_smallest.py create mode 100755 comp/work/13/reverse_words.py create mode 100755 comp/work/13/task.py (limited to 'comp/work/13') 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)) diff --git a/comp/work/13/reverse_words.py b/comp/work/13/reverse_words.py new file mode 100755 index 0000000..974ae4d --- /dev/null +++ b/comp/work/13/reverse_words.py @@ -0,0 +1,6 @@ +def reverse_words(words): + words.split(" ") + output = [] + for i in words: + + diff --git a/comp/work/13/task.py b/comp/work/13/task.py new file mode 100755 index 0000000..ca7cd5e --- /dev/null +++ b/comp/work/13/task.py @@ -0,0 +1,14 @@ +def get_name(name): + return name.upper() + + +def get_age(current_age): + return current_age + 1 + +def get_details(name,age): + print(f"the persons name is {get_name(name)}, and next year they will be {get_age(age)}") + +name = input("name: ") +age = int(input("current age: ")) + +get_details(name,age) -- cgit v1.2.3