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
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
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.
@python_pioneers
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:
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 แจแแซแตแแแแแข
Output :
แจแแญ แซแแแ code if-else statement แฐแ แ แแ แจแแแแแขแจ if statement condition False แตแแแแฃ else block แแตแฅ แซแแ code executed แญแแแ แแแต แแแข แแฅแฉ even แซแแแ "kutir is not even" แจแแ text printed แฅแแฒแแแแ แจแแแแ แฅแแฐแแ แแแ แฅแแฝแแแแข
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
แ แฃแแแ แตแแ แญแณแฝแ แตแ 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
Enjoy Them!โก๏ธโก๏ธโก๏ธโก๏ธ
#wallpapers
@python_pioneers
๐ฅ3โค1๐1๐1
"To attract positive things in your life, start by giving off positive energy."
-Unkown
Have a nice day!
#EnglishQoutes
@python_pioneers
-Unkown
Have a nice day!
#EnglishQoutes
@python_pioneers
โค3๐2
"แแแซแ แซแฐแจแ แฅแ
แดแถแฝ แ แ แ แแบ แแ
แจแแ แตแ แแซแแฝ"
"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