Python Pioneers: A Beginner's Guide 🇪🇹 – Telegram
Python Pioneers: A Beginner's Guide 🇪🇹
8.88K subscribers
345 photos
39 videos
24 files
61 links
Welcome to Python Pioneers: Empowering Ethiopian students to embark on their coding journey. 🚀🌐🗺📱🖥💻🖱🛰

DM 📩 : @MntsntZP
Download Telegram
😁😂😁😂😁😂😂😂

Pinterest_Et

#Fun


@python_pioneers
😁11😎1
Function ለምን ይጠቅመናል?

1. Code Reusability:

Functions አንድን የፃፍነውን code በተደጋጋሚ እንድንጠቀመው ይረዳናል። አንዴ Function define ካረግን ፣ ብዙ ግዜ call እያረግነው በፈረግነው ቦታ መጠቀም እንችላለን። ስለዚህ የሆነን code በተደጋጋሚ መፃፍ አይጠበቅብንም።


   def greet():
print("Hello, world!")

greet() # Reusing the same function
greet()

2. Modularity:

ይህ የ Function ጥቅም ደግሞ አንድን complex problem ለብዙ የተለያዩ parts ከፍለን እያንዳንዱን part ደግሞ function ፅፈንለት በቀላሉ መፍትሄ እንድናገኝ ይረዳናል።


   def calculate_area(radius):
return 3.14 * radius * radius

3. Readability:

ለላኛው የ Function ጥቅም ደግሞ የፃፍነው code በቀላሉ እንዲነበብ ያረገዎል፣ This helps other developers (and you, in the future) understand the code easily.


   def calculate_average(marks):
return sum(marks) / len(marks)

4. Avoiding Redundancy:

አንድ የ code block ብዙ ጊዜ መጠቀም ከፈለግን፣ አንድ ጊዜ function define አርገን በቀላሉ ብዙ call ማድረግ እንችላለን፣ ይህ ደግሞ በተደጋጋሚ እየፃፍን ስህተት እንዳንሰራ ይረዳናል።


   def convert_to_fahrenheit(celsius):
return (celsius * 9/5) + 32

•••

#Functions

@python_pioneers
@python_pioneers
👍2
Function of Functions

Here are some AI generated pictures about functions.

#Functions

@python_pioneers
👍4
Calling a Function

# Define a function that adds two numbers
def add_numbers(num1, num2):
result = num1 + num2
return result

# Calling the function
sum_result = add_numbers(5, 3)

print("The sum is:", sum_result) # Outputs: The sum is: 8

Calling a function ማለት literally ከተረጎምን Function መጥራት ነው፣ ይህም ማለት አንድ define የተደረገ function executed እንዲሆን መጥራት እንደማለት ነው።
When you call a function, the program jumps to the function's code, runs it, and then continues from where the function was called.

ማብራሪያ

add_numbers: ይሄ function ሁለት parameter ይወስዳል፣ ከዛ ይደምራቸውና ውጤቱን return ያረጋል።

Return የሚባለው statement ጥቅሙ ውጤቱን ወደ callerኡ ይመልስና functionኡን exit ማድረግ ነው።

Return statement executed ከሆነ functionኡን ያቆመውና functionኡ call በተደረገበት specified የሆነውን ውጤት ይሰጣል።

Return statement እንዴት ይሰራል?

- Syntax: return <expression>

- <expression> ማንኛውም አይነት value ሊሆን ይችላል variable, even a result of a calculation.
ማንኛውም ነገር ከ return statement ቀጥሎ ከሌለ functionኡ by default 'None' return ያረጋል።
ሌላኛው የ return statement ጥቅም አንድ function define አርገን ከሆነ ከfunctionኡ የሚገኘውን ውጤት ከfunctionኡ ውጪ በሆነ variable ውስጥ store አርገን እንድንጠቀመው ይረዳናል።

ምሳሌ

def square(number):
return number ** 2

# Calling the function and storing the result
result = square(4)

print("The square is:", result) # Outputs: The square is: 16

በዚህ ምሳሌ `return number ** 2' የ 'number'ን squared value 'square()' የተባለው function call ወደተደረገበት ይልካል፣ ከዛ return የተደረገው squared value ከfunctionኡ ውጪ result የተባለ variable ውስጥ store ይደረግና፣ then print ይደረጋል።

#Return
#CallingaFunction
#Function

@python_pioneers
@python_pioneers
@python_pioneers
👍3
Lambda Function
🔥3👍2
Do the right thing, even when no one is watching.

It's called Integrity.

#Quote

@python_pioneers
👍7👏2🕊21
Are you a current 2017 freshman university student or have you been accepted by Ethiopian universities?
Anonymous Poll
64%
Yes
36%
No
👎1
Good evening!

Current 2017 freshman university students: If you are interested in transferring to Asosa University, please DM me using this telegram account 👉 @MntsntZP

@python_pioneers
Python Pioneers: A Beginner's Guide 🇪🇹 pinned «Good evening! Current 2017 freshman university students: If you are interested in transferring to Asosa University, please DM me using this telegram account 👉 @MntsntZP @python_pioneers»
We've reached 450 subscribers now, we're 4.5/10 of our goal which is huge for a channel with no videos. So thank you so much. Keep on subscribing and sharing.
youtube.com/@Dagmawi_Babi

Thank You So Much! ❤️


@Dagmawi_Babi
5
Hey everyone! Sorry it's been a while since our last meeting. Today, we're diving into an exciting lesson about lambda functions in Python.

Looking forward to seeing you all!

#LambdaFunctions

@python_pioneers
🔥5👍1
Lambda Functions in Python

Lambda functions በሌላ ስማቸው anonymous functions በ Python Programming language ውስጥ at a runtime አጭር እና unnamed functions እንድንፈጥር ያግዙናል። ሌላ ቦታ መጠቀም ያማንፈልገውን function በአንድ ቦታ ብቻ እንድንፈጥር ይረዱናል።

What is a Lambda Function?

Lambda function የፈለግነውን ያህል argument ይወስዳል ነገር ግን አንድ expression ብቻ ነው የሚቀበለው። Expression ኡ evaluated ከሆነ በዃላ value return ይደረጋል።

The syntax for a lambda function is:

lambda arguments: expression

የlambda functions ቁልፍ ባህሪያት

1. Anonymous: Lambda functions ስም የላቸውም፣ that means they're anonymous.

2. Single Expression: አንድ expression ብቻ ነው የሚይዙት፣ ይህ ደግሞ ከregular functions less powerful ያደርጋቸዋል።

3. Can Take Multiple Arguments: ብዙ argument የመቀበል አቅም አላቸው።

Lambda function ከregular function በsyntax እንዴት እንደሚለይ ከስር ባለው ምሳሌ መረዳት ይቻላል።

ምሳሌ : Basic Lambda Function

# Regular function
def add(x, y):
return x + y

# Lambda function
add_lambda = lambda x, y: x + y

print(add(2, 3)) # Output: 5
print(add_lambda(2, 3)) # Output: 5

to be contd...

#LambdaFunctions
#Functions
#Python

@python_pioneers
Forwarded from AAU Software Engineering community (Aquaphile 👨‍✈️)
Media is too big
VIEW IN TELEGRAM
Hello, ASEC 👨‍💻👩‍💻  friends and family!

This is our educational channel by ASEC! Our goal and dedication is to create best learning and networking environment for tech enthusiasts and programmers of all backgrounds. Although we are a new channel with a smaller subscriber base, we previously had a channel with 21.3k subscribers that was lost for no reason. Don't judge us by our current subscribers count instead we invite you to join us to explore and enjoy learning plus feel free to invite your besties to this exciting experience.

In addition to our educational contents, we also offer Smart ICT Solutions for organizations and individuals.With extensive experience in this field, we are committed to provide valuable services to those in need.
👍31