Hey everyone!
ቀጣይ ትምህርታችን የሚሆነው ስለ for loop ነው።
Stay tuned for some exciting exercises and examples in our upcoming session!
#ForLoop
@python_pioneers
ቀጣይ ትምህርታችን የሚሆነው ስለ for loop ነው።
Stay tuned for some exciting exercises and examples in our upcoming session!
#ForLoop
@python_pioneers
👍4
FOR LOOP
For loopን በ Python የምንጠቀመው የሆነን line of code ወይም እንደ list, tuple, string, range, numbers... የመሳሰሉ sequence of elements በተደጋጋሚ execute ለማረግ ነው። ይህ ደግሞ በsequenceኡ እያንዳንዱ item ላይ ተመሳሳይ operation እንድናካሄድ ይረዳናል።
በPython የfor loop basic syntax ይሄን ይመስላል:
በsyntaxኡ ውስጥ:
- "item" የሚለው በእያንዳንዱ Iteration(ድግግሞሽ) የsequenceኡን every item ይወክላል(placeholder variable ነው።)
- "sequence" የሚለው ደግሞ የሚወክለው loopኡ iterate የሚያረግባቸው elements of sequenceን ነው።
እስኪ ከላይ ያለውን ሀሳብ በምሳሌ እንየው፣ በምሳሌው ደግሞ የሆነ የቁጥሮች ስብስብ አለ ፣ ከዛም በlistኡ iterate እያረገ እያንዳንዱን ቁጥር print የሚያደርግ program ለመፃፍ እንሞክራለን።
We will learn deeply about lists in the future...
This would output:
...to be continued
#ForLoop
@python_pioneers
@python_pioneers
For loopን በ Python የምንጠቀመው የሆነን line of code ወይም እንደ list, tuple, string, range, numbers... የመሳሰሉ sequence of elements በተደጋጋሚ execute ለማረግ ነው። ይህ ደግሞ በsequenceኡ እያንዳንዱ item ላይ ተመሳሳይ operation እንድናካሄድ ይረዳናል።
በPython የfor loop basic syntax ይሄን ይመስላል:
for item in sequence:
# do something with item
በsyntaxኡ ውስጥ:
- "item" የሚለው በእያንዳንዱ Iteration(ድግግሞሽ) የsequenceኡን every item ይወክላል(placeholder variable ነው።)
- "sequence" የሚለው ደግሞ የሚወክለው loopኡ iterate የሚያረግባቸው elements of sequenceን ነው።
እስኪ ከላይ ያለውን ሀሳብ በምሳሌ እንየው፣ በምሳሌው ደግሞ የሆነ የቁጥሮች ስብስብ አለ ፣ ከዛም በlistኡ iterate እያረገ እያንዳንዱን ቁጥር print የሚያደርግ program ለመፃፍ እንሞክራለን።
We will learn deeply about lists in the future...
numbers = [1, 2, 3, 4, 5]
for num in numbers:
print(num)
This would output:
1
2
3
4
5
...to be continued
#ForLoop
@python_pioneers
@python_pioneers
👍4🥰1
... continued
For loopን ከrange() functionም ጋር መጠቀም እንችላለን፣ በዚህ ደግሞ የሆኑ range of numbers ላይ iterate እናረጋለን።
የ
የ
- start
This would output:
...to be continued
@python_pioneers
@python_pioneers
@python_pioneers
For loopን ከrange() functionም ጋር መጠቀም እንችላለን፣ በዚህ ደግሞ የሆኑ range of numbers ላይ iterate እናረጋለን።
የ
range() function Python built-in function ሲሆን sequence of numbers እንድንፈጥር ይረዳናል። እናም ከfor loop ጋር ተጠቅመን over the sequence of numbers iterate ማድረግ እንችላለን።የ
range() function syntax ይሄን ይመስላል፡range(start, stop, step)
- start
is the starting number of the sequence (optional, default is 0)
- stop is the ending number of the sequence (required)
- step is the difference between each number in the sequence (optional, default is 1)
ምሳሌ 1: በrange function ከ0-9 ቁጥሮችን ለማውጣት ከፈለግን፡ range(9) ማለት እንችላለን።
ምሳሌ 2:
for kutir in range(1, 6):
print(kutir)
This would output:
1
2
3
4
5
...to be continued
@python_pioneers
@python_pioneers
@python_pioneers
👍6🔥1
"You can't go back and change the beginning, but you can start where you are and change the ending."
-C.S. Lewis
ጸጸት ውስጥ መግባታችን እና በግዜ ወደ ኋላ ሄደን ልናደርጋቸው የምንችላቸውን ነገሮች ያለማቋረጥ ማሰብ ቀላል ነው። ነገር ግን ያለፈው ነገር ላይ መቆየታችን ምንም አይጠቅመንም። ወደ ኋላ ተመልሰን የሆነውን(የሰራናቸውን ስህተቶች) መለወጥ አንችልም ነገር ግን አሁን ጀምረን ብንታረም ለውጥ ማምጣት እንችላለን።
መልካም ምሽት!
#Quotes
@python_pioneers
@python_pioneers
-C.S. Lewis
ጸጸት ውስጥ መግባታችን እና በግዜ ወደ ኋላ ሄደን ልናደርጋቸው የምንችላቸውን ነገሮች ያለማቋረጥ ማሰብ ቀላል ነው። ነገር ግን ያለፈው ነገር ላይ መቆየታችን ምንም አይጠቅመንም። ወደ ኋላ ተመልሰን የሆነውን(የሰራናቸውን ስህተቶች) መለወጥ አንችልም ነገር ግን አሁን ጀምረን ብንታረም ለውጥ ማምጣት እንችላለን።
መልካም ምሽት!
#Quotes
@python_pioneers
@python_pioneers
🔥4❤3💯1
Forwarded from 𝔉𝖎𝖙𝖔 𝖒𝖆𝖓
https://news.1rj.ru/str/tapswap_mirror_bot?start=r_5685218492
🎁 +2.5k Shares as a first-time gift
🎁 +2.5k Shares as a first-time gift
👍1🥰1
PYTHON PIONEERS
Begin your coding journey with us! Join our Telegram and YouTube channels and start learning programming in Amharic today.
Start now and unlock endless possibilities with us.
Let's code together!
@python_pioneers
@python_pioneers
Begin your coding journey with us! Join our Telegram and YouTube channels and start learning programming in Amharic today.
Start now and unlock endless possibilities with us.
Let's code together!
@python_pioneers
@python_pioneers
👍4❤1🔥1
Python Range Function
Practice Problems
⏭️
range()
Practice Problems
⏭️
1. What does the following code snippet do in Python?
for i in range(5): print(i)
for i in range(5): print(i)
Anonymous Quiz
57%
a) Prints numbers from 0 to 4
5%
b) Prints numbers from 1 to 5
23%
c) Prints numbers from 0 to 5
15%
d) Prints numbers from 1 to 4
2. What is the correct syntax for using the range function with a start, end, and step value specified?
Anonymous Quiz
46%
a) range(start, end, step)
19%
b) range(start:end:step)
32%
c) range(start, step, end)
3%
d) range(end, start, step)
3. What is the output of the following code snippet:
for i in range(2, 8, 2): print(i)
for i in range(2, 8, 2): print(i)
Anonymous Quiz
25%
a) 2, 3, 4, 5, 6, 7
69%
b) 2, 4, 6
6%
c) 3, 5, 7
0%
d) 2, 5
👍1
4. In Python, what is the default step value for the range function if not specified?
Anonymous Quiz
61%
a) 1
6%
b) 2
24%
c) 0
9%
d) The step value must always be specified
5. Which of the following statements is true about the range function in Python?
Anonymous Quiz
27%
a) It returns a list containing the specified range of elements
8%
b) It only accepts integer values as arguments
50%
c) It can be used to generate sequences of numbers for iteration
15%
d) It requires the use of a loop to print the values returned by the function.
Python Pioneers: A Beginner's Guide 🇪🇹
1. What does the following code snippet do in Python?
for i in range(5): print(i)
for i in range(5): print(i)
👆Codes in some of the questions are not correctly indented, do them as they were!
Perceptive:
Two twin boys were raised by an alcoholic father. One grew up to be an alcoholic and when asked what happened, he said “I watched my father."
The other grew up and never drank in his life. When asked what happened, he said “I watched my father."
Two boys, same dad, two different perspectives.
Your perspective in life will determine your destination.
GOOD NIGHT!
#EnglishStories
@python_pioneers
@python_pioneers
Two twin boys were raised by an alcoholic father. One grew up to be an alcoholic and when asked what happened, he said “I watched my father."
The other grew up and never drank in his life. When asked what happened, he said “I watched my father."
Two boys, same dad, two different perspectives.
Your perspective in life will determine your destination.
GOOD NIGHT!
#EnglishStories
@python_pioneers
@python_pioneers
❤5👍2🥰1
Denoscription for the above code
The above Python code will print the string "hello world" ten times. Here's a breakdown of how it works:
1. The for loop is set to iterate over the range from 1 to 10 inclusive. The range(1, 11) function generates a sequence of numbers starting from 1 up to (but not including) 11.
2. On each iteration of the loop, the print('hello world') statement is executed.
Because the loop iterates 10 times, "hello world" will be printed 10 times, each on a new line.
Here is the code:
Output
#ForLoop
@python_pioneers
@python_pioneers
The above Python code will print the string "hello world" ten times. Here's a breakdown of how it works:
1. The for loop is set to iterate over the range from 1 to 10 inclusive. The range(1, 11) function generates a sequence of numbers starting from 1 up to (but not including) 11.
2. On each iteration of the loop, the print('hello world') statement is executed.
Because the loop iterates 10 times, "hello world" will be printed 10 times, each on a new line.
Here is the code:
for i in range(1, 11):
print('hello world')
Output
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
#ForLoop
@python_pioneers
@python_pioneers
👍4🥰2❤1
Everyone Has a Story in Life
A 24 year old boy seeing out from the train’s window shouted…
“Dad, look the trees are going behind!”
Dad smiled and a young couple sitting nearby, looked at the 24 year old’s childish behavior with pity, suddenly he again exclaimed…
“Dad, look the clouds are running with us!”
The couple couldn’t resist and said to the old man…
“Why don’t you take your son to a good doctor?” The old man smiled and said…“I did and we are just coming from the hospital, my son was blind from birth, he just got his eyes today.”
Every single person on the planet has a story. Don’t judge people before you truly know them. The truth might surprise you.
መልካም ምሽት!
#EnglishStory
@python_pioneers
@python_pioneers
❤5👍1🥰1
Forwarded from TIKVAH-MAGAZINE
#ጥቆማ
የኢንፎርሜሽን መረብ ደህንነት አስተዳደር (ኢንሳ) በሀገር አቀፍ ደረጃ እድሜአቸው ከ11 አመት በላይ ለሆኑ እና ፍላጎት ላላቸው የሳይበር ክህሎት የስልጠና ምዝገባ እና የቻሌንጅ መርሃግብር መጀመሩን በሰጠው ጋዜጣዊ መግለጫ ገልጿል።
ተቋሙ በሁሉም የሀገሪቱ ክፍል ያሉ ወጣቶችን መመዝገብ የሚችሉ መሆኑን የገለፀ ሲሆን በሀገር አቀፍ ደረጃ የሚመዘገቡ ሰልጣኞችን ደረጃ በደረጃ የሚመለምልበት ፈተና (ቻሌንጅ) እና ክህሎታቸውን የሚለይበት ሳይንሳዊ መስፈርት ማዘጋጀቱን ተገልጿል።
ተቋሙ የሚሰጣቸው የስልጠና መስኮች ምንድናቸው ናቸው?
- በሳይበር ደህንነት፣
- በሳይበር ደህንነት ዘርፍ የድረገፅ፣ የመተግበሪያ እና ተያያዥ ልማት (development)፣
- የስማርት ፕሮጀክት ሲስተሞች ፣
- በኤሮስፔስ እና ሎሎችም እንደሆኑ ተገልጿል።
ስልጠናው በአዲስ አበባ ዩኒቨርሲቲ ቴክኖሎጂ ለአንድ ወር ይሰጣል የተባለ ሲሆን አመልካቾች በዌብሳይት https://talent.Insa.gov.et በመግባት እስከ ግንቦት 30/ 2016 ዓ/ም መመዝገብ እንድትችሉ ጥቆማ ቀርቧል።
ለበለጠ መረጃ +251904311833 +251943579970
+251904311837
@TikvahethMagazine
የኢንፎርሜሽን መረብ ደህንነት አስተዳደር (ኢንሳ) በሀገር አቀፍ ደረጃ እድሜአቸው ከ11 አመት በላይ ለሆኑ እና ፍላጎት ላላቸው የሳይበር ክህሎት የስልጠና ምዝገባ እና የቻሌንጅ መርሃግብር መጀመሩን በሰጠው ጋዜጣዊ መግለጫ ገልጿል።
ተቋሙ በሁሉም የሀገሪቱ ክፍል ያሉ ወጣቶችን መመዝገብ የሚችሉ መሆኑን የገለፀ ሲሆን በሀገር አቀፍ ደረጃ የሚመዘገቡ ሰልጣኞችን ደረጃ በደረጃ የሚመለምልበት ፈተና (ቻሌንጅ) እና ክህሎታቸውን የሚለይበት ሳይንሳዊ መስፈርት ማዘጋጀቱን ተገልጿል።
ተቋሙ የሚሰጣቸው የስልጠና መስኮች ምንድናቸው ናቸው?
- በሳይበር ደህንነት፣
- በሳይበር ደህንነት ዘርፍ የድረገፅ፣ የመተግበሪያ እና ተያያዥ ልማት (development)፣
- የስማርት ፕሮጀክት ሲስተሞች ፣
- በኤሮስፔስ እና ሎሎችም እንደሆኑ ተገልጿል።
ስልጠናው በአዲስ አበባ ዩኒቨርሲቲ ቴክኖሎጂ ለአንድ ወር ይሰጣል የተባለ ሲሆን አመልካቾች በዌብሳይት https://talent.Insa.gov.et በመግባት እስከ ግንቦት 30/ 2016 ዓ/ም መመዝገብ እንድትችሉ ጥቆማ ቀርቧል።
ለበለጠ መረጃ +251904311833 +251943579970
+251904311837
@TikvahethMagazine