8. If Statement [Python 3 Programming Tutorials]

preview_player
Показать описание
The video will describe “if” statement in python, “if control” statement, the use of “if” statement, how to create “if” statement and the flow of “if” statement.

Topics that are covered in this Video:
0:00 Overview
1:08 input() function
1:48 int() function
5:42 Operators

🔖Hashtags🔖

#Ifstatement #python #ifpython #pythonifelse #ifelseinpython #pythonif #elifpython #elseinpython #pythonifelseladder #ifelsepythonexamples

Next Video:

Рекомендации по теме
Комментарии
Автор

Thank you for this nice tutorial series! Its straight to the point, simple explanation .

AtulVijayP
Автор

Yeh! done successfully. thanks for knowledge sharing

number=input("Insert number:")
number=int(number)
if number<10:
print("failed")
elif number>=10 and number<20:
print("need improvement")
elif number>=20 and number<=30:
print("good achivement")
else:
print("please check number")

sibirnayek
Автор

Thank you so much for u r wonderful u r a great teacher....

rajualwarappan
Автор

doing excesise is one of best way to gain confidence:
thank you so much sir love from nepal:
your teaching skill(style) is very fun and interesting

bishalshrismagar
Автор

Hi,
Thanks for the tutorial,
I am executing the same code as you, but when I am entering any dish from the indian, chinese or italian, program is only executing the else block and not the remaining block. I have added breakpoint also at if, elif blocks but it is not going inside the blocks. Any help would be appreciated.

indian=["Samosa", "Dal", "Roti", "Paneer"]
chinese=["Noodles", "egg role", "Fried Rice"]
italian=["Pizza", "pasta", "french fries"]

dish=input("Enter the dish to check for its type:")

if dish in indian:
print("It is the indian dish")
elif dish in chinese:
print("It is the chinese dish")
elif dish in italian:
print("It is the italian dish")
else:
print("It is not in the indain, chinese, italian cuisines types")

ravindersingh
Автор

NIce playlist. I'm learning Python from basics and i'm accustomed to Anaconda Jupiter notebook. I found Pycharm little bit difficult IDE. Can i continue with Jupiter or should I try to accustom with Pycharm as well ? Thanks

LiyaUlagam
Автор

Thank you for these sessions...very helpful 👍👍

rajalakshmiramya
Автор

All your sessions are awesome. And I’ve a query.. In corporate, do Python developers use PyCharm or any other IDE ?

srikrithibharadwaj
Автор

I have never eaten samosa,
but the happiness you describe it ... i need to try :)

SkillsForTeams
Автор

Can anyone tell me why the input entered by the user is considered a string & not an integer or a float? Would it not be considered an integer or float since the user is inputting a number & not text?

KAEMO
Автор

what we do if i do not want to specify letters in upper case and lower case.

asraalyssa
Автор

best thank to the instructor, very nice learn

mohdnasser
Автор

is it okay if i code this in jupyter, it seems easy to use

riddhidigital
Автор

hi sir, when i learn python , it shows a comment "Process finished with exit code 0", i cannot understand it.

not_lina
Автор

can you tell me how to do this thing if connection_str == "bad":
print("cant run program (this is a beta program)")
else:
print("running program")
pass

i have made a variable called connection and made it a input but I want to do if the person connection is bad it will not run the program.

bob-zbed
Автор

Thank you very much. May Buddha grant you and your family all that is good for your souls.

Home-kjwm
Автор

@codebasics: in If statement exercise . We need your help to make changes to the code.
2: Write a python program that can tell you if your sugar is normal or not. Normal fasting level sugar range is 80 to 100.

We need to use AND Operator for low sugar range 80 to 100:

patientsugar = float(input("Enter sugar level no: "))

# 3.1 - Ask user to enter his fasting sugar level
if patientsugar > 80 and patientsugar < 100:
print("Normal Sugar")

# 3.2 - If it is above 100 then print that it is high otherwise print that it is normal
elif patientsugar > 100:
print("High Sugar")

# 3.3 - If it is below 80 to 100 range then print that sugar is low
elif patientsugar < 80:
print("low sugar")

newbielearning
Автор

it is only working when i give the dish name in quotes as input .. if not it is giving error. why is that ? I have the same code as yours

sandhyathippesh
Автор

pandagoi
# Graterthen and less then program
x=input("enter the value")
x=int(x)
y=input("enter the Value")
y=int(y)
if y<x:
print("y is less then x")
elif y==x:
print("y equal to x")
else:
print("y is greater then x")

vnwbkbn
Автор

I' am not able to debug, showing connection to python debugger is failed, why ??

creator_rajaa