"መልካም ያደረጉ ብዙ
ሴቶች አሉ አንቺ ግን
ከሁሉ ትበልጫለሽ"
"Many women do
noble things but
you surpass them all"
--> @nirvanaland7
መልካም የእናቶች ቀን!
#MothersDay
@python_pioneers
ሴቶች አሉ አንቺ ግን
ከሁሉ ትበልጫለሽ"
"Many women do
noble things but
you surpass them all"
--> @nirvanaland7
መልካም የእናቶች ቀን!
#MothersDay
@python_pioneers
❤7👍1👎1
if...elif…else statement
if...elif…else statement: ብዙ አማራጮች ሊኖሩት የሚችል ወይም ብዙ conditions የሚፈልግ problem ካለ ይሄን መንገድ እንጠቀማለን ።
በተማሪ ውጤት ላይ በመመስረት 'Excellent, Very Good, Good, Satisfactory, or Fail’ ብሎ print የሚያረግ program ለመስራት አስበናል እንበል።
በእንደዚህ ዓይነት ሁኔታዎች ፣ የፈለግነውን ያህል elif statement ተጠቅመን ለተለያዩ conditions የተለያዩ executions እንዲኖሩት Pythonን በመጠቀም ማድረግ እንችላለን።
else is the same as else and if combined together
Multiple if's means your code would go and check all the if conditions, where as in case of elif, if one if condition satisfies it would not check other conditions..
የ elif keyword በPython interpreterኡን "ከዚህ ቀደም ያለው condition(s) እውነት ካልሆነ/ኑ ይሄኛውን ሞክር" እንደማለት ነው። or " else...if" ማለት ነው።
በምሳሌ እንየው:
Pseudocode:
የመጀመሪያው condition true ከሆነ, በif block ውስጥ ያለው statement executed ይሆናል።
የመጀመሪያው condition false ከሆነ , ቀጣዩ elif condition check ይደረጋል።
የelif condition true ከሆነ, በelif block ውስጥ ያለው statement executed ይሆናል።
ሁለቱም conditions false ከሆኑ ደግሞ , በelse block ውስጥ ያለው statement executed ይሆናል።
...ይቀጥላል
#Condional
@python_pioneers
if...elif…else statement: ብዙ አማራጮች ሊኖሩት የሚችል ወይም ብዙ conditions የሚፈልግ problem ካለ ይሄን መንገድ እንጠቀማለን ።
በተማሪ ውጤት ላይ በመመስረት 'Excellent, Very Good, Good, Satisfactory, or Fail’ ብሎ print የሚያረግ program ለመስራት አስበናል እንበል።
በእንደዚህ ዓይነት ሁኔታዎች ፣ የፈለግነውን ያህል elif statement ተጠቅመን ለተለያዩ conditions የተለያዩ executions እንዲኖሩት Pythonን በመጠቀም ማድረግ እንችላለን።
else is the same as else and if combined together
Multiple if's means your code would go and check all the if conditions, where as in case of elif, if one if condition satisfies it would not check other conditions..
የ elif keyword በPython interpreterኡን "ከዚህ ቀደም ያለው condition(s) እውነት ካልሆነ/ኑ ይሄኛውን ሞክር" እንደማለት ነው። or " else...if" ማለት ነው።
በምሳሌ እንየው:
Pseudocode:
if condition1:
#statement to execute if condition1 is true
elif condition2:
#statement to execute if condition2 is true
else:
#statement to execute if both conditions are false
የመጀመሪያው condition true ከሆነ, በif block ውስጥ ያለው statement executed ይሆናል።
የመጀመሪያው condition false ከሆነ , ቀጣዩ elif condition check ይደረጋል።
የelif condition true ከሆነ, በelif block ውስጥ ያለው statement executed ይሆናል።
ሁለቱም conditions false ከሆኑ ደግሞ , በelse block ውስጥ ያለው statement executed ይሆናል።
...ይቀጥላል
#Condional
@python_pioneers
በቀጣይ elif statement በመጠቀም የተማሪን👨💻👩💻👨🎓 Performance መሰረት በማድረግ grade እንድንሰጥ የሚያስችለንን program እንዴት መፃፍ እንደምንችል እናያለን።⏭️
የPythonን elif statement በመጠቀም ሊቀረፍ የሚችል real-life problem ቢኖር Grading system ነው።
Here's an example:
በዚህ program, exam_score variable የተማሪውን ውጤት ከመቶ ይቀበላል(ወይም user-input እንዲቀበል ማድረግ እንችላለን ይህ ደግሞ for multiple scores grade check እንድናረግ ይረዳናል) ከዛም programኡ በውጤቱ ልክ grade ይሰጠናል።
The
❓ጥያቄ ካላችሁ መጠየቅ ትችላላችሁ
⏭️በቀጣይ input ከ user እንዴት መቀበል እንደምንችል እንማራለን
ትምህርቶቹን ከወደዳችኋቸው በ👍 ግለፁልን
#elif
#example
@python_pioneers
@python_pioneers
Here's an example:
# Program to calculate the grade of a student based on their exam score
# declaring a variable to store exam score
exam_score = 87
# Calculate grade based on exam score
if exam_score >= 90:
grade = "A"
elif exam_score >= 80:
grade = "B"
elif exam_score >= 70:
grade = "C"
elif exam_score >= 60:
grade = "D"
else:
grade = "F"
# Display the grade
print("The grade for the exam score of ", exam_score, "is", grade)
በዚህ program, exam_score variable የተማሪውን ውጤት ከመቶ ይቀበላል(ወይም user-input እንዲቀበል ማድረግ እንችላለን ይህ ደግሞ for multiple scores grade check እንድናረግ ይረዳናል) ከዛም programኡ በውጤቱ ልክ grade ይሰጠናል።
The
elif statements help determine the appropriate grade based on different score ranges. Finally, the grade is displayed. ❓ጥያቄ ካላችሁ መጠየቅ ትችላላችሁ
⏭️በቀጣይ input ከ user እንዴት መቀበል እንደምንችል እንማራለን
ትምህርቶቹን ከወደዳችኋቸው በ👍 ግለፁልን
#elif
#example
@python_pioneers
@python_pioneers
👍8🥰1
Forwarded from Python Pioneers: A Beginner's Guide 🇪🇹
10. How do you comment out a line of code in Python?
Anonymous Quiz
26%
A. Using the // symbol
8%
B. Using the /* */ symbols
64%
C. Using the # symbol
1%
D. Using the -- symbol
Forwarded from Kelemat Ads
temari info.apk
24.4 MB
I developed this Flutter app to help high school and preparatory students. the app empowers students to make informed decisions about university and study field selection.
By simply indicating their favorite subject, the app recommends relevant university programs, making the exploration process smoother and more efficient.
🤝 If you want to build flutter apps Join my telegram channel. https://news.1rj.ru/str/temaripathcommunity
📈 visit my website to learn dart and flutter https://temaripath.netlify.app (videos, notes, quizzes included)
By simply indicating their favorite subject, the app recommends relevant university programs, making the exploration process smoother and more efficient.
🤝 If you want to build flutter apps Join my telegram channel. https://news.1rj.ru/str/temaripathcommunity
📈 visit my website to learn dart and flutter https://temaripath.netlify.app (videos, notes, quizzes included)
👏2👍1
Python Programs with If Condition
1. A simple grading program that checks if a student's test score is above a certain threshold and assigns a letter grade accordingly.
2. A temperature converter program that checks if the user input is in Celsius or Fahrenheit and converts it to the other unit.
3. A program that checks if a given number is even or odd.
4. A simple calculator program that checks if the user input is an addition, subtraction, multiplication, or division operation and performs the calculation accordingly.
5. A program that checks if a given year is a leap year or not.
6. A program that compares two numbers and prints out the larger one.
7. A program that checks if a given number is positive, negative, or zero.
8. A program that checks if a user inputted password meets certain criteria (e.g. minimum length, presence of special characters).
•
•
•
👨💻👨💻👩💻👩💻👩💻👩💻👨💻👨💻👨💻👨💻👨💻👨💻
PRACTICE MAKES PERFECT!
#Programs
@python_pioneers
@python_pioneers
1. A simple grading program that checks if a student's test score is above a certain threshold and assigns a letter grade accordingly.
2. A temperature converter program that checks if the user input is in Celsius or Fahrenheit and converts it to the other unit.
3. A program that checks if a given number is even or odd.
4. A simple calculator program that checks if the user input is an addition, subtraction, multiplication, or division operation and performs the calculation accordingly.
5. A program that checks if a given year is a leap year or not.
6. A program that compares two numbers and prints out the larger one.
7. A program that checks if a given number is positive, negative, or zero.
8. A program that checks if a user inputted password meets certain criteria (e.g. minimum length, presence of special characters).
•
•
•
👨💻👨💻👩💻👩💻👩💻👩💻👨💻👨💻👨💻👨💻👨💻👨💻
PRACTICE MAKES PERFECT!
#Programs
@python_pioneers
@python_pioneers
👍3
😁3
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