Python Pioneers: A Beginner's Guide πŸ‡ͺπŸ‡Ή
8.82K subscribers
346 photos
40 videos
24 files
64 links
Welcome to Python Pioneers: Empowering Ethiopian students to embark on their coding journey.

πŸ“’ Channel: @python_pioneers
πŸ‘₯ Group: @python_pioneers_chat
Download Telegram
CONTROL FLOW IN PYTHON

Program flow α‰°αˆ« α‰ α‰°αˆ« α‹¨αˆšαŠ¨αˆ°α‰΅ αŠα‹α£ α‰ Python የPython interpreter α‹¨α‰°αƒαˆα‹αŠ• program α‹¨αˆšα‹«αŠα‰ α‹ αŠ αˆαŠ• αŠ₯αŠ“αŠ•α‰° α‹­αˆ„αŠ• post αŠ₯αŠ•α‹°αˆα‰³αŠα‰‘α‰΅ sequentially αŠα‹α£ α‰ αŠ αŠ•α‹΅ αŒŠα‹œ αŠ αŠ•α‹΅ መሡመር፣ ከግራ α‹ˆα‹°α‰€αŠ αŠ₯αŠ“ αŠ¨αˆ‹α‹­ α‹ˆα‹° ታች αˆ›αˆˆα‰΅ αŠα‹α’

Interpreterኑ operations αŠ₯αŠ“ functions execute α‹¨αˆšα‹«αˆ¨αŒˆα‹ α‰ α‰°α‰€αˆ˜αŒ‘α‰ α‰΅ order αˆ²α‹«αŒˆαŠ›α‰Έα‹ αŠα‹α’ α‹­αˆ„ αŠα‹ ታዲያ Control Flow α‹¨αˆαŠ•αˆˆα‹α’

α‹«αˆˆ Control Flow expressions αŠ αŠ•α‹΅ program sequentially executed α‹¨αˆšαˆ†αŠ‘ lists of statements αŠα‹α’ ነገር αŒαŠ• Control Flow α‰ αˆ˜αŒ α‰€αˆ α‹¨α‰°α‹ˆαˆ°αŠ‘ code blocks conditionally(α‹ˆα‹­αˆ α‰ α‰…α‹΅αˆ˜ αˆαŠ”α‰³) αŠ₯αŠ“ repeatedly(α‹ˆα‹­αˆ α‰ α‰°α‹°αŒ‹αŒ‹αˆš) executed αŠ₯αŠ•α‹²αˆ†αŠ‘ αˆ›α‹΅αˆ¨αŒ αŠ₯αŠ•α‰½αˆ‹αˆˆαŠ•α£ α‹­αˆ… α‹°αŒαˆž α‰ αŒ£αˆ α‹αˆ΅α‰₯ሡα‰₯ α‹¨αˆ†αŠ‘ codes αŠ₯αŠ•α‹΅αŠ•α…α αŠ₯α‹΅αˆ α‹­αˆ°αŒ αŠ“αˆα’

Python α‰ αŠ αŠ•α‹΅ program α‹αˆ΅αŒ₯ Control Flow ለመፍጠር if, elif( short for else if) αŠ₯αŠ“ else α‹¨αˆ˜αˆ³αˆ°αˆ‰α‰΅αŠ• keywords α‹­αŒ α‰€αˆ›αˆα’ αŠ₯αŠα‹šαˆ… keywords α‹°αŒαˆž αŠ₯αŠ•α‹° traffic α‰°α‰†αŒ£αŒ£αˆͺ Control Flow α‹ˆα‹΄α‰΅ αŠ₯αŠ•α‹°αˆšαˆ„α‹΅ α‹­αŠαŒαˆ«αˆ‰α’

Keywords in Python are reserved words that have a specific meaning and purpose in the language.

α‹¨α‹›αˆ¬α‹ α‰΅αˆαˆ…αˆ­α‰³α‰½αŠ• αŠ₯α‹šαˆ… αˆ‹α‹­ α‹«αˆα‰ƒαˆ α‰ α‰€αŒ£α‹­ ሡለ αŠ₯α‹«αŠ•α‹³αŠ•α‹± Control Flow expression α‰ αŒ₯αˆα‰€α‰΅ αŠ₯αŠ“α‹«αˆˆαŠ•α’

#FlowContro

@python_pioneers
@python_pioneers
πŸ‘3
Watch the vedio we uploaded below to understand more about flow control πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡
πŸ‘1πŸ’”1
✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️

αŠ₯αŠ•αŠ³αŠ• αˆˆαŠ’α‹¨αˆ±αˆ΅ αŠ­αˆ­αˆ΅α‰Άαˆ΅ α‹¨α‰΅αŠ•αˆ³αŠ€ α‰ α‹“αˆ αˆ˜α‰³αˆ°α‰’α‹« α‰ αˆ°αˆ‹αˆ αŠ α‹°αˆ¨αˆ³α‰½αˆ!

መልካም α‹αˆ²αŠ«!

α‹αˆ²αŠ« αŒαŠ• α‰΅αˆ­αŒ‰αˆ™ αˆαŠ•α‹΅αŠα‹?

@python_pioneers
@python_pioneers
❀5πŸ™ˆ2πŸ‘1
Flow Control in Python

-Continued lesson

...pending
⚑⚑⚑⚑⚑⚑⚑⚑⚑⚑⚑⚑⚑

α‰ α‹šαˆ…αŠ›α‹ α‰΅αˆαˆ…αˆ­α‰³α‰½αŠ• ሡለ αŠ₯α‹«αŠ•α‹³αŠ•α‹± Flow Control expressions in Python α‰ detail αŠ₯αŠ“α‹«αˆˆαŠ•α’

1. if statement:

if statement α‰ αŒ£αˆ α‰ α‰₯α‹™ α‹¨αˆšα‰³α‹ˆα‰… control flow statement type αŠα‹α£ α‹¨α‰°αˆˆα‹«α‹© conditions α‰ αˆ›α‹¨α‰΅ conditionαŠ‘αŠ• α‹¨αˆšα‹«αˆŸαˆ‹α‹ code block executed αŠ₯αŠ•α‹²αˆ†αŠ• α‹«α‹°αˆ­αŒ‹αˆα’

ለምሳሌ:

የ αŠ αŠ•α‹΅ a α‹¨αˆšα‰£αˆ variable value negative α‹ˆα‹­αˆ positive αŠ₯αŠ•α‹°αˆ†αŠ αˆˆαˆ›α‹ˆα‰… αˆαˆαŒˆαŠ“αˆ αŠ₯αŠ•α‰ αˆα£ αˆ°αˆˆα‹šαˆ… αˆαˆˆα‰±αŠ•αˆ conditions( α‰…α‹΅αˆ˜ αˆαŠ”α‰³α‹Žα‰½) set αˆˆαˆ›αˆ¨αŒ if statement αŠ₯αŠ•αŒ α‰€αˆ›αˆˆαŠ•α’ a ከ 0 α‰ αˆ‹α‹­ αŠ¨αˆ†αŠ "It's positive" α‹ˆα‹­αˆ a ከ 0 α‹¨αˆšα‹«αŠ•αˆ΅ αŠ¨αˆ†αŠ "It's negative" α‰₯ሎ print αŠ₯αŠ•α‹²α‹«α‹°αˆ­αŒαˆαŠ• αˆ›αˆˆα‰΅ αŠα‹α’

set α‹«αˆ¨αŒαŠα‹ condition αŠ₯α‹αŠα‰΅ αŠ¨αˆ†αŠ የዛ block code executed α‹­αˆ†αŠ“αˆα£ α‹ˆα‹­αˆ conditionኑ αˆ€αˆ°α‰΅ αŠ¨αˆ†αŠ α‹« code block ignore α‹­α‹°αˆ¨αŒ‹αˆα’

Here is the code for the above case:

a = 20
if a>0:
print("It is Positive")



Output:

It's Positive αˆαŠ­αŠ’α‹«α‰±αˆ 20 ከ 0 α‹¨αˆšα‰ αˆαŒ₯ ቁαŒ₯ር αˆ΅αˆˆαˆ†αŠ conditionኑ αŠ₯α‹αŠα‰΅ αŠα‹α£ αˆ°αˆˆα‹šαˆ… the block of code within it is executed, in this case "It is Positive".

the other case:

if a<o:
print("It is Negative")


αŠ₯α‹šαˆ… αŒ‹αˆ­ αŠ₯αŠ•α‹°αˆα‰³α‹©α‰΅ α‹°αŒαˆž conditionኑ αˆ€αˆ°α‰΅ αˆ΅αˆˆαˆ†αŠ Interpreterኑ code blockαŠ‘αŠ• ignore α‹«αˆ¨αŒˆα‹‹αˆ: so the statement within it executed αŠ αˆαˆ†αŠαˆα’


Next: elif and else

Stay Tuned!

#FlowControl
#If

@python_pioneers
@python_pioneers
πŸ‘6
⚑What is the digital language you learned first?

If it is not listed here, comment it.
Anonymous Poll
30%
HTML
25%
Python
7%
JavaScript
34%
C++
3%
Java
1%
Ruby
❀1πŸ‘1
90 Votes so far and C++ is leading....
This media is not supported in your browser
VIEW IN TELEGRAM
Buggy Buggy πŸ˜”πŸ˜”πŸ˜”πŸ˜πŸ˜

Let's have some fun! 😊

#Fun

@python_pioneers
😁4
Story Time

Please read it patiently!

A Wise Man’s Jokes:

A wise man once faced a group of people who were complaining about the same issues over and over again. One day, instead of listening to the complaints, he told them a joke and everyone cracked up laughing.

Then, the man repeated the joke. A few people smiled.

Finally, the man repeated the joke a third time–but no one reacted.

The man smiled and said, β€œYou won’t laugh at the same joke more than once. So what are you getting from continuing to complain about the same problem?”

The Moral:

You’re not going to get anywhere if you keep complaining about the same problem but do nothing to fix it. Don’t waste your time complaining, expecting other people to continue to react to your complaints. Instead, take action to make a change.

መልካም αˆαˆ½α‰΅!

#EnglishStories

@python_pioneers
❀4πŸ‘3
α‰ α‰€αŒ£α‹­: IF-ELSE STATEMENT IN PYTHON

Stay Tuned!

@python_pioneers
@python_pioneers
Here is the data from the survey we conducted regarding the first digital language our channel members learned.

Most of the voters learned C++ first.

147 votes so far

@python_pioneers
❀1😁1
IF-ELSE STATEMENT IN PYTHON

α‰ α‰£αˆˆαˆα‹ α‰΅αˆαˆ…αˆ­α‰³α‰½αŠ• ሡለ if statement in python αˆ›αˆˆα‰΅αˆ αŠ αŠ•α‹΅ condition αˆ‹α‹­ α‰ αˆ˜αˆ˜αˆ΅αˆ¨α‰΅ የconditionαŠ‘αŠ• Truth value α‰ αˆ›α‹¨α‰΅ α‹¨α‰°αˆˆα‹«α‹© code blocks run αŠ₯αŠ•α‹΅αŠ“αˆ¨αŒ αŠ₯αŠ•α‹°αˆšαˆ¨α‹³αŠ• α‰ α‰΅αŠ•αˆΉαˆ α‰’αˆ†αŠ• αŠ α‹­α‰°αŠ“αˆα£ α‹›αˆ¬ α‹°αŒαˆž αŠ¨α‹› α‹¨α‰€αŒ αˆˆα‹αŠ• α‰΅αˆαˆ…αˆ­α‰΅ αŠ₯αŠ•αˆ›αˆ«αˆˆαŠ•α’

α‹­αˆ… የ if-else statement ለ decision-making ከsimple if statement α‹¨αˆšαˆ»αˆ αŠ αŒαˆαŒαˆŽα‰΅ α‹­αˆ°αŒ£αˆα’ ከif statement αŒ‹αˆ­ α‰ α‰°αˆ˜αˆ³αˆ³α‹­ αˆ˜αŠ•αŒˆα‹΅ αŠα‹ α‹¨αˆšαˆ°αˆ«α‹ ነገር αŒαŠ• የsimple if statement condition Truth value False(αˆ€αˆ°α‰΅) αŠ¨αˆ†αŠ αˆαŠ•αˆ ነገር αŠ αŠ“αŒˆαŠαˆ(nothing will be printed) αˆ›αˆˆα‰΅αˆ it does nothing: ነገር αŒαŠ• if-else statement αˆ΅αŠ•αŒ α‰€αˆ የif condition False αŠ¨αˆ†αŠ የelse block α‹αˆ΅αŒ₯ α‹«αˆˆα‹ expression executed α‹­αˆ†αŠ“αˆα’

αŠ₯ሡαŠͺ α‰ αˆαˆ³αˆŒ αŠ₯αŠ•α‹¨α‹:

αŠ αŠ•α‹΅ kutir α‹¨αˆšα‰£αˆ variable αŠ αˆˆαŠ• αŠ₯αŠ•α‰ αˆα£ αŠ₯αŠ“αˆ ለvariable assign α‹¨α‰°α‹°αˆ¨αŒˆα‹ ቁαŒ₯ር even αŠ₯αŠ•α‹°αˆ†αŠ αŠ₯αŠ“αˆ¨αŒ‹αˆˆαŠ•α’
So here is the code for it: αˆ˜αŒ€αˆ˜αˆͺα‹« ለvariableኑ α‹¨αˆ°αŒ αŠα‹ value 4 αŠα‹α’ α‹¨α‰°αŒ α‰€αˆαŠα‹ condition α‹°αŒαˆž (kutir % 2 == 0) αŠα‹α£ α‹­αˆ… α‹°αŒαˆž variableኑ α‹αˆ΅αŒ₯ α‹¨α‰°α‹«α‹˜α‹ ቁαŒ₯ር even αŠ₯αŠ•α‹°αˆ†αŠ check αˆˆαˆ›α‹΅αˆ¨αŒ αŠα‹(A number is even if it is divided by two without a remainder)

Here is the code:

kutir = 4

if kutir % 2 == 0:
print("kutir is Even")


Output : kutir is Even


αŠ₯α‹šαˆ… αŒ‹αˆ­ conditionኑ αŠ₯α‹αŠα‰΅ αˆ΅αˆˆαˆ†αŠ( 4 even αˆ΅αˆˆαˆ†αŠ) the block of code inside the if statement is executed in this case "kutir is Even" printed α‹­αˆ†αŠ“αˆα’

αŒαŠ• αŠ₯ሺ what will happen if we change the value of the variable to 3?

የvariableኑ value 3 αŠ¨αˆ†αŠ the condition becomes False α‹« αˆ›αˆˆα‰΅ the statement under if block is not executed( nothing will be printed) αˆ›αˆˆα‰΅ αŠα‹α’ αŠ₯α‹šαˆ… αŒ‹αˆ­ αŠα‹ ታዲያ else block α‹¨αˆšα‹«αˆ΅αˆαˆαŒˆα‹α’


kutir = 3

if kutir % 2 == 0:
print("kutir is Even")


Output :

αŠ¨αˆ‹α‹­ α‹«αˆˆα‹αŠ• code if-else statement α‰°αŒ α‰…αˆ˜αŠ• αŠ¨αƒααŠα‹α’α‹¨ if statement condition False αˆ΅αˆˆαˆ†αŠα£ else block α‹αˆ΅αŒ₯ α‹«αˆˆα‹ code executed α‹­αˆ†αŠ“αˆ αˆ›αˆˆα‰΅ αŠα‹α’ ቁαŒ₯ሩ even αŠ«αˆαˆ†αŠ "kutir is not even" α‹¨αˆšαˆ text printed αŠ₯αŠ•α‹²αˆ†αŠ•αˆαŠ• αŠ¨αˆαˆˆαŒαŠ• αŠ₯αŠ•α‹°α‹šαˆ… αˆ˜αƒα αŠ₯αŠ•α‰½αˆ‹αˆˆαŠ•α’

kutir = 3

if kutir % 2 == 0:
print("kutir is Even")
else:
print("kutir is not Even")


Output :kutir is not Even


3 even αˆ΅αˆ‹αˆαˆ†αŠ if block α‹αˆ΅αŒ₯ α‹«αˆˆα‹ code α‹­α‹˜αˆˆαˆαŠ“ else block α‹αˆ΅αŒ₯ α‹«αˆˆα‹ code executed α‹­αˆ†αŠ“αˆ-> "kutir is not Even" printed α‹­αˆ†αŠ“αˆ αˆ›αˆˆα‰΅ αŠα‹α’

α‰€αŒ£α‹­: if..elif..else

PythonαŠ• α‰ αŠ αˆ›αˆ­αŠ› αŠ₯αŠ•αˆ›αˆ­!

#IfElse

@python_pioneers
@python_pioneers
⚑2πŸ‘2
Here are some beautiful programming related wallpapers.

Enjoy Them!⚑️⚑️⚑️⚑️

#wallpapers

@python_pioneers
πŸ”₯3❀1πŸ‘1πŸ‘Œ1