Python if...else Conditionals (for Decision Making) # 7

preview_player
Показать описание
Decision making is required when we want to execute a code only if a certain condition is satisfied.
The if…elif…else statement is used in Python for decision making.

In this video, we will learn about decision making in Python using the if...else statement. The if statement is used to execute certain blocks only when the test condition is true. It can also have an optional else clause that runs when the test condition is false. The if statement can also have multiple elif clauses to handle more than two test cases.

~

Watch our videos and revise them with our Python App!

Timestamps:
0:00 Intro
0:40 Python if statement
3:50 Python if...else statement
5:51 Python if...elif...else statement
9:04 Programming Task
9:57 Recap

Find Programiz elsewhere:
-------------------------------------------------

Python if...else Conditionals (for Decision Making) # 7

#python #learnprogramming #programiz #pythonifelse
Рекомендации по теме
Комментарии
Автор

🔥 Learn Python with a more hands-on experience with Programiz PRO—interactive lessons, quizzes & challenges.

programizstudios
Автор

Thanks for the lessons!!

number = float(input('Your number', ))

if number > 0:
print('the number positive')

elif number < 0:
print('the number is negative')

else:
print('the number is exactly 0')

MrKampay
Автор

Video has been so much more helpful than my professors MIS class. Thank you so much for the clear explanation!!

malavdesai
Автор

number = float(input("Enter a number: "))

if number >0:
print("The number is positive")
elif number <0:
print("The number is negative")
else:
print("The number is 0")

fatimam
Автор

I just discovered this course and it is excellent! Everything is well explained for people like me, a complete beginner from Liberal Arts!

chipile
Автор

Thank u sir....one of the best tutorials I found in teaching style really simple ..easy.... 🙏🙏🙏🙏🙏. Jai Puneeth bro

govardhanrt
Автор

Amazing explanation, easier can't be! I started Python to learn by my self almost 1 week ago (never before that did it). Such courses and short video are really good! Regards from Bulgaria!

topan
Автор

Number = int(input("Enter a number: "))
if Number >= 1:
print("the number is positive")
if Number <= -1:
print("the number is negative")
if Number ==0:
print("the number is 0")

I wasted some time working on the 0 because i wrote = instead of ==

Keep up the good content

zPqck
Автор

num = float(input('enter the number :'))

if num == 0:
print('the number is 0')

elif num < 0:
print('the number is negative')

else:
print('the number is positive')

every one has the different approach
happy coding

hungernonstop
Автор

Hi there, you are a very good teacher! I am just starting to learn coding and love your chanel, very easy to follow, and the examples helps us understand! Very good☆☆☆☆☆

dedeb
Автор

number = float(input("Enter Your Number: "))


if number > 0:
print("The number is postive")
if number < 0:
print("The number is negative")
if number == 0:
print("The number is 0")

endeavored
Автор

number = int(input("What is your number"))
if number >= 1:
print("Number is positive")

if number == 0:
print("Number is zero")

elif number <= 0:
print("Number is negative")

kelsiegwanz
Автор

this vid was more helpful than my whole ict class for the year, thx for this vid

norahegazy
Автор

This is the code i got omg it works

values = int(input('Enter your number: '))

if values > 0:
print('The number is positive')
elif values < 0:
print('The number is negative')
else:
print('The number is 0')

imjustsayin
Автор

I gusse there is no other creator who can make this level of content that to for free BTW thanks for the online complier it helped me a lot

HariPrasad-mnvu
Автор

for i in range(5):
number=float(input("Enter the number:"))
if number>0:
print("The number is positive")

elif number<0:
print("The number is negative")
else:
print("the number is 0")

theonlymaster
Автор

I just seen your Website for Data Structures.... It was awesome 🙂 !! Thanks

PritishMishra
Автор

numder = int(input("Enter numder:"))


if numder > 0:
print("it a positive numder")

elif numder < 0:
print("it a negitave numder")

else:
print("it is zero")

arbindkumarforeigntradecon
Автор

number=int(input("enter a number" or "variable"))
if number>=1:
print("This number is positive")

elif number<0:
print("This number is negative")

else:
print("The number is zero")

KiranPatil-jbvi
Автор

print ("Number analyzer")
num = int(input("Enter your number "))
if num > 0:
print ("The number is positive")
if num == 0:
print ("okay its a zero number")
if num < 0:
print ("its negetive")

saureetchakrabarti