SamiTech Code
340 subscribers
132 photos
12 videos
4 files
87 links
Computer Science student and software developer focused on building impactful products, exploring AI, and solving real-world challenges with technology.
My portfolio.... sami.pro.et

“Your efforts today are your goals tomorrow.”
Download Telegram
Good morning fam
GM everyones, Cuz of connection problem, I didn't post here whatever, today morning we'll gonna continue our learning journey...Thanks👍
Python Lambda Functions:
A lambda function can take any number of arguments, but can only have one expression.
#syntax: lambda arguments : expression A lambda function that adds two numbers:
add = lambda x, y: x + y
print(add(4, 9))
A lambda function that multiply two numbers:
multiply = lambda a, b: a * b
print(multiply(3, 8)

)
NB: why we use lambda functions?👀
Use lambda functions when an anonymous function is required for a short period of time. Keep in mind about python lambda functions, if you've any questions regarding to this you're welcome🫡
Good Afternoon guys I hope you're doing well and this's our topic we'll focus on it Python Recursion & Fibonacci Sequence. Up to that keep shining
👍1
🤔Have you heard about recursive? I hope you learned that in math Python recursion:
it's when a function calls itself.
A simple recursive function that counts down from 5:
def countdown(n):
if n <= 0:
print("Done!")
else:
print(n)
countdown(n - 1)
countdown(5)

"""every recursive function must have two parts:
1. Base case - a condition that stops the recursion
2. Recursive case - the function calling itself with a modified argument
here without a base case, the function would call itself forever, causing a stack overflow error
🥺"""
def factorial(n):
#Base case
if n == 0 or n == 1:
return 1
#Recursive case
else:
return n * factorial(n - 1)
print(factorial(5))
Fibonacci Sequence:
is a classic example where each number is the sum of the two preceding ones.
The Sequence starts with 0 and 1
eg; 0, 1, 1, 2, 3, 5, 8, 13,... here we can use recursion to find a specific number in the sequence: means 0 + 1 = 1 then 1 + 1 = 2,...
Find the 7th number in the fibonacci sequence:
def fibonacci(n):
if n <= 1:
return n
else:
return fibonacci(n - 1) + fibonacci(n - 2)
print(fibonacci(7))

Understand Fibonacci then we'll move to the next step, we're now gained basic knowledge of python programming.😀💪
SamiTech Code pinned «🤔Have you heard about recursive? I hope you learned that in math Python recursion: it's when a function calls itself. A simple recursive function that counts down from 5: def countdown(n): if n <= 0: print("Done!")…»
Good Morning guys💫, Since we covered basic python programming, I think it's good to start 👇
Data stracture & Algorithm.

What do you think please give your thought in the comment section.✍️✍️✍️
STEP-BY-STEP DSA LEARNING ROADMAP (WITH PYTHON)💪
Phase 1 – Foundation📊 1.Time and Space Complexity: What we have to know?👇 -What is Time Complexity? -What is Space Complexity? -Why we need Complexity? -Big-O Notation -Common types of time complexity -How to understand each time complexity? -Focus on interview questions -Practice problem so guys since, we've started the 2nd phase DSA, let's prepare ourselves for our journey and stay focus on it we'll become smart💪
1
As a note👇
What is Time Complexity?
Time Complexity tells us:
How the running time of an algorithm grows as input size increases. NB: We don't measure time in seconds.
We measure number of operations.

What is Space Complexity?
Space Complexity tells us:
How much extra memory an algorithm uses as input size increases.
Why we need Complexity?
Imagine two programs solving the same problem:
Program A → works fast for small input but slow for large input
Program B → works fast even for large input
👉 Complexity helps us choose the better one.
👍2
Good Evening 👋
BIG-O NOTATION:👇
Big-O describes the worst-case performance Common time complexities 1. O(1) - Constant Time: Time doesn't depend on input size 2. O(n) - Linear Time: Time grows proportionally with input size 3. O(n²) - Quadratic Time: Nested loops 4. O(log n) - Logarithmic Time: input size halves each step 5. O(n log n) - Linear + Logarithmic Time: Combination of linear and logarithmic We'll see them one by one in the next..Stay tuned with me🧑‍💻
1
Good Morning fam
Happy sunday💫
SamiTech Code pinned «As a note👇 What is Time Complexity? Time Complexity tells us: How the running time of an algorithm grows as input size increases. NB: We don't…»
Guys HRU all just sorry for my late, since we've just started DSA this course is needed! you need to know the basic concept of DSA You can learn it from youtube tutorial, but since we're focused on Python programming watch this video there is about 20 videos you might get the basic understanding of DSA. he teaches DSA in python👉🏾 https://youtu.be/IR_S8BC8KI0?si=5E7Uwc4E2xGUiRW6
If someone ask you, what is Big O notation? In simple what is your answer? 👉🏾The letter O was chosen by Bachmann to stand for Ordnung, meaning the order of approximation. In computer science, big O notation is used to classify algorithms according to how their run time or space requirements grow as the input size grows. I'll post for you, what I get and you can do it so...
1
Keep in mind:
many of us know that we can use timers to test the speed of our code. But this raises a couple problems. The other main problem being that this still does not give us an objective way to talk about the difference between two blocks of code. This is exactly where Big O Notation comes into play. It provides a way for us to communicate the efficiency of our code in a way that is consistent and clear. So then what do we use if not time?👇 The simple answer is counting operations.
SamiTech Code pinned «Guys HRU all just sorry for my late, since we've just started DSA this course is needed! you need to know the basic concept of DSA You can learn it from youtube tutorial, but since we're focused on Python programming watch this video there is about 20 videos…»