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
Smiling Children Foundation

Bringing hope and smiles to those in need. Together, we can make a lasting impact on the lives of children who need us most.

"We rise by lifting others."

- Robert Ingersoll


Let’s stand united in supporting those who need it the most. 💙

#ElshaddaiShonkoru
#SupportTheNeedy
#SmilingChildren
#HelpingHands

@smiling_children
@smiling_children
@smiling_children
3
This media is not supported in your browser
VIEW IN TELEGRAM
Python Exercises for Beginners

A python program that displays even numbers from 1 to 10.


Vedio credit : Programming with Mosh

#PythonExercises

@python_pioneers
👍2
A python program that displays even numbers from 1 to 10

for num in range(1, 11):
if num % 2 == 0:
print(num)

Output

2
4
6
8
10

#PythonExercises

@python_pioneers
👍5
Functions in programming

ሰላም ቤተሰብ👋

ዛሬ Functions በPython programming language ምን እንደሆኑ እና ለምን እንደሚጠቅሙን እናያለን🎉

Functions are super cool because they let us reuse blocks of code to make our programs more efficient and organized. 🧑‍💻 You can pass in parameters, return results, and create clean, modular code. Let’s master functions together! 🚀

Check out more here: Functions in Programming

👆ከላይ ያለውን ማስፈንጠሪያ በመንካት ስለ Functions የበለጠ መረዳት ትችላላችሁ።

#Functions

@python_pioneers
@python_pioneers
🔥4
@python_pioneers ቻነል አዲስ ከሆናችሁ ከስር ያለውን Button በመጫን ከዚህ በፊት የተማርናቸውን ትምህርቶች ማግኘት ትችላላችሁ።

#PythonPioneers

@python_pioneers
👍3
😁😂😁😂😁😂😂😂

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