แจ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://t.me/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://t.me/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
Forwarded from Python Pioneers: A Beginner's Guide ๐ช๐น (Zaphnath Paaneah) via @OfficialBannersBot
Explore the Lessons We've Been Learning: Click the Links Below to Dive into Various Topics
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://t.me/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