diff --git a/__pycache__/main.cpython-310.pyc b/__pycache__/main.cpython-310.pyc index e1eec8c..f2398cb 100644 Binary files a/__pycache__/main.cpython-310.pyc and b/__pycache__/main.cpython-310.pyc differ diff --git a/__pycache__/test_main.cpython-310.pyc b/__pycache__/test_main.cpython-310.pyc index f1e95ec..039407f 100644 Binary files a/__pycache__/test_main.cpython-310.pyc and b/__pycache__/test_main.cpython-310.pyc differ diff --git a/main.py b/main.py index 2719019..cebec5d 100644 --- a/main.py +++ b/main.py @@ -12,6 +12,15 @@ """ def add_numbers(a, b): pass + add_numbers(2,3) == 5 + add_numbers(-1,4) == 4 + + return sum + +print(add_numbers) + + + # Exercise 2: Subtract Numbers @@ -23,7 +32,13 @@ def add_numbers(a, b): subtract_numbers(3, 5) -> -2 """ def subtract_numbers(a, b): - pass + pass + + subtract_numbers = (5,3) == 2 + subtract_numbers = (5,2) == -2 + + return subtract_numbers(2) +print(subtract_numbers) # Exercise 3: FruitLoop @@ -44,6 +59,19 @@ def subtract_numbers(a, b): def fruitloop(n): pass + fruitloop(n) + 3 + 6 + Fruit + 5 + Loop + + + + + + + # Exercise 4: Fibonacci """ @@ -68,6 +96,18 @@ def fibonacci(n: int): def find_max(numbers: list): pass + numbers = 3 ,-1 + list = [1,2,3][-1,-3,-5] + + for numbers in list: + return find_max + else: + numbers != list + + print(find_max) + + + # Exercise 6: Find Minimum """ @@ -78,7 +118,15 @@ def find_max(numbers: list): find_min([-1,-5,-3]) -> -5 """ def find_min(numbers: list): - pass + pass + + for i in range: + list != numbers + + else: + numbers + + # Exercise 7: Person Class @@ -102,6 +150,16 @@ def __init__(self, name: str, age: int): def greet(self): pass + + self.name = str + self.age = int + + p = Person("Alice" ,"25") + p.greet() = "hello my name is Alice and I am 25 years old" + + + + @@ -121,4 +179,4 @@ def greet(self): print(find_min([1, 2, 3, 4, 5])) # Should print 1 p = Person("Alice", 25) print(p.greet()) # Should print greeting message -""" +""" \ No newline at end of file