Python Pioneers: A Beginner's Guide 🇪🇹 – Telegram
Python Pioneers: A Beginner's Guide 🇪🇹
8.87K 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
👍2
Infinite Loop

While loopን ስንጠቀም common የሆነ ችግር ቢኖር የinfinite loop መፈጠር ነው። ይህም infinite loop conditionኡ False መቼም በማይሆንበት ጊዜ ይፈጠራል።


Example of an infinite loop:

while True:
print("This will print forever")

ከላይ ያለው ፕሮግራም "This will print forever" የሚለውን ዐ/ነገር ያለ ገደብ print ያረጋል።


Breaking Out of a Loop

Infinite Loop avoid ለማረግ "break" statement መጠቀም እንችላለን፣ ይህም የሆነ condition set አርገን እውነት በሚሆንበት ጊዜ loopኡን exit እንድናረግ ይረዳናል።



i = 1
while i <= 10:
print(i)
if i == 5:
break # Exit the loop when i is 5
i += 1

ከላይ ያለው ፕሮግራም መጀመሪያ የተፃፈው ከ 1 እስከ 10 ያሉ ቁጥሮችን print እንዲያረግ ቢሆንም የ'i' value 5 ሲሆን እንዲያቆም ቅድመ-ሁኔታ ስላስቀመጥን ልክ የ'i' value 5 ሲሆን loopኡ ይቆማል።


Using Else with While Loop

Python 'else' clause ከ while loop ጋር እንድንጠቀም ይፈቅዳል። የ'else' block executed የሚሆነው የ while loop condition ሀሰት ሲሆን ነው። (i.e., the loop terminates naturally).

ምሳሌ

i = 1
while i <= 5:
print(i)
i += 1
else:
print("Loop has ended")

...ይቀጥላል

#WhileLoop

@python_pioneers
@python_pioneers
👍41
😂😂😂😂😂😂😂😂😂

-> @lewtayew

#Fun

@python_pioneers
😁4👍1
Common Use Cases

1. Waiting for User Input: የፈለግነውን data እስከምናገኝ User input በተደጋጋሚ እንድንቀበል ይረዳናል።


2. Processing Data Streams: መጨረሻ ላይ እስከምንደርስ data ከfile ወይም ከ network stream continuously እንድናነብ ይረዳናል።

3. Polling: የአንድን resource status periodically check እንድናረግ ይረዳናል።

ምሳሌ: User Input

Here's an example where we keep asking the user for a positive number:

number = -1
while number < 0:
number = int(input("Enter a positive number: "))
print("You entered: ", number)

ከላይ ያለው ፕሮግራም userኡ positive ቁጥር እንዲያስገባ repeatedly ይጠይቀዋል፣ ቁጥሩን ደግሞ print ያረጋል፣ if the user enters a positive number the loop ends, because the condition becomes false.

...to be continued

#WhileLoop

@python_pioneers
@python_pioneers
👍2
👋 Let me share with you some beautiful and powerful quotes that I gathered from different sources.👇


People were created to be loved. Things were created to be used. The reason why the world is in chaos, is because things are being loved and people are being used.

- John Green

You get a strange feeling when you're about to leave a place. Like you'll not only miss the people you love but you'll miss the person you are now at this time and this place, because you'll never be this way ever again.

- Azar Nafisi

People ask if you have graduated, if you have married, if you have kids, as if life is like a checklist. No one asks you if you're happy

- Criolo

If you get tired, learn to rest, not to quit.

- Banksy

The sun does not forget a village just because it is small.

- African Proverb

A bird sitting on a tree is never afraid of the branch breaking, because its trust is not on the branch but on its own wings. Always believe in yourself

- Anonymous

Raise your words, not your voice. It is rain that grows flowers, not thunder.

- Rumi

If you think you are too small to make a difference, try to sleep with a mosquito in a room.

- Dalai Lama

You can't keep blaming yourself. Just blame yourself once and move on.

- Homer Simpson

Have a nice day!

#Quotes

@python_pioneers
@python_pioneers
7👍2🔥1🙏1😎1
Fun_damentals_of_Python_Book_by_Bemnet_Girma_1715444510.pdf
10.6 MB
For Python beginners, this book is a must-have.

-Someone

#Books

@python_pioneers
👍41
Forwarded from ATC NEWS (MuJa. M)
🚀 Gain the Skills and International Certifications You Need for Remote Work 🌍

Upwork, Toptal, and more - ever wondered what it takes to secure remote work through these top platforms?

Discover ALX’s dynamic online tech courses, tailored to meet today’s job market demands. Whether you’re starting out or looking to deepen your expertise, we offer a variety of courses, including:

AWS Cloud Computing
Back-End Web Development
Front-End Web Development
Data Analytics
Salesforce

💡 Start with our 100% free, two-month-long “ALX Foundations” program - a gateway to these advanced courses for a nominal admin fee! 🔥

🌟 Ready to lead in the tech industry? Secure your spot now at www.alxethiopia.com.

Let’s ignite your career journey!
Application deadline: July 2nd, 2024
#InnovateYourPath #FutureReady #SkillUp
👍1
Forwarded from Code Tactics (𓄂𝕾𝖈𝖔𝖗𝖕𝖎𝕯𝖊𝖛)
👍3
ሰላም እንደምን ቆያችሁ የቻነላችን። የ @python_pioneers Subscribers!

ሳንገናኝ ብዙ ቆይተናል፣ ግን በዚህ ክረምት ትምህርታችንን እንቀጥላለን፣ ማንኛውም አይነት ጥያቄ ወይም ይሄን ብታረጉ፣ ብትጨምሩ ብላችሁ የምታስቡትን suggestion ከመስጠት ወደዃላ አትበሉ።

በዚህ ክረምት እዚህ ቻነል ላይ የሚፃፉ ኮንተንቶች:

▫️Contd lessons on Python
▫️Award-winning questions and quizzes
▫️Tech related news
▫️Live sessions
▫️Daily inspiring quotes
▫️Tech related stuffs
▫️...

በዚህ ክረምት ፕሮግራምንግ የመማር ሀሳብ ካላችሁ ይህ ቻነል አሪፍ ነው፣ ከእኛ ጋር በመማር ክረምታችሁን ፍሬያማ እንደምታደርጉም እርግጠኞች ነን።


መልካም ጊዜ ይሁንላችሁ!


@python_pioneers
@python_pioneers
👍41
Control Flow Modifiers in Python

በpython Control flow modifiers የምንላቸው በloop ወይም በconditional statements ውስጥ ከገቡ normal flow of executionን የሚቀይሩ statementኦች ናቸው።
እነዚህም modifiers እነ break, continue, እና pass ናቸው

1. break Statement
ይህን የ break statement የምንጠቀመው አንድን loop prematurely ወይም መጨረሻ ላይ ሳይደርስ ለማቆም ስንፈልግ ነው። እናም loopኡ terminate ያረግና ከloopኡ ቀጥሎ መጀመሪያ ያለው line of code executed ይሆናል።


- ለምሳሌ:

  for i in range(10):
if i == 4:
break
print(i) # Output: 0, 1, 2, 3


2. continue Statement

ይህኛው modifier ደግሞ የloopኡ current iteration ውስጥ ያለውን code ዘለን ወደ ቀጣይ iteration ለማለፍ ስንፈልግ እንጠቀመዋለን።
loopኡን terminate አያረገውም ፣ it just skips the remaining code for the current iteration.


- ለምሳሌ:

  for i in range(10):
if i % 2 == 0:
continue
print(i) # Output: 1, 3, 5, 7, 9

..to be contd

#break
#continue

@python_pioneers
@python_pioneers
3
...contd

3. pass Statement

It is a no-operation statement in Python
- pass statementን የምንጠቀመው እንደ place holder ነው። ማለትም የሆነ code እየፃፋችሁ ከሆነ ግዜ በኃላ የምትጨምሩት line of code ካለ 'pass' ን እንደ place holder ትጠቀሙታላችሁ።

- ለምሳሌ:

  if condition:
pass # To be implemented later


4. else Clause with Loops

else clause ከloop ጋር መጠቀም እንችላለን፣ as long as a break statement is not used.

- ለምሳሌ:

  for i in range(5):
print(i)
else:
print("Loop completed") # This will be printed because the loop was not terminated by a break


- ምሳሌ : elseን after break ስንጠቀም:

  for i in range(5):
if i == 3:
break
print(i)
else:
print("Loop completed") # This will not be printed because the loop was terminated by a break


እነዚህን control flow modifiers መረዳት የloops እና conditionals flow manage በማረግ efficient እና readable code መፃፍ እንድትችሉ ይረዳችኋል።

#pass
#break

@python_pioneers
@python_pioneers
🔥1
እስኪ እነዚህን ከflow control modifiers የወጡ ጥያቄዎችን ሞክሯቸው⏭️