#19 Python Tutorial for Beginners | If Elif Else Statement in Python

#19 Python Tutorial for Beginners | If Elif Else Statement in Python

Telusko

6 лет назад

1,350,181 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

fashion inventory 👔
fashion inventory 👔 - 14.09.2023 10:06

It's great to learn from you by far the easy catch of codes 🙇

Ответить
Rakhel Khongsai account
Rakhel Khongsai account - 12.09.2023 11:59

Where is that moth thing hes using

Ответить
Sultan Hussain Najafi
Sultan Hussain Najafi - 11.09.2023 11:45

n1 = float(input("gib der ersten NUmmer ein: "))
n2 = float(input("gib der zweiten NUmmer ein: "))
n3 = float(input("gib der dritten NUmmer ein: "))
if n1 > n2 and n1 > n3:
print('der ersten Nummer ist am großen.')
elif n2 > n3 and n1:
print('Zweiten NUmmer ist am großen.')
elif n1 == n2 and n2 == n3:
print('Alle Nümmern sind gleisch.')
else:
print('Dritten Nummer ist am großen.')

Ответить
Sultan Hussain Najafi
Sultan Hussain Najafi - 11.09.2023 11:44

print('der ersten Nummer ist am großen.')
elif n2 > n3 and n1:
print('Zweiten NUmmer ist am großen.')
elif n1 == n2 and n2 == n3:
print('Alle Nümmern sind gleisch.')
else:
print('Dritten Nummer ist am großen.')


It works for me :)

Ответить
ANNAM RAJESH
ANNAM RAJESH - 10.09.2023 19:45

x=int(input("enter a number"))
if x>0:
print("positive")
if x<0:
print("negative")

Ответить
Mani Teja Mamidala
Mani Teja Mamidala - 27.08.2023 19:30

the code is....
x=int(input("enter the 1st number"))
y=int(input("enter the 2nd number"))
z=int(input("ener the 3rd number"))
if x>y and x>z:
print("1st number is greater")
elif y>x and y>z:
print("2nd number is greater")
else:
print("3rd number is greater")

Ответить
Tumu Varshik Reddy
Tumu Varshik Reddy - 24.08.2023 08:16

Answer for 2nd question
x=input()
y=input()
z=input()
if x>y:
print(x)
if y>z:
print(y)
if z>x:
print(z)

Ответить
Santhosh megavath
Santhosh megavath - 16.08.2023 14:39

nice

Ответить
FOODS AND DELIGHTS
FOODS AND DELIGHTS - 08.08.2023 07:15

Thank you Sir,
Love from Rawalpindi

Ответить
KIRAN KUMAR
KIRAN KUMAR - 29.07.2023 10:03

To compare the greatest of the 3 numbers.

x = int(input("Please enter first value: "))
y = int(input("Please enter second value: "))
z = int(input("Please enter third value: "))

if x==y and x==z:
print('All the values are same')

elif x>y and x>z:
print(x)

elif y>x and y>z:
print(y)

else:
print(z)

Ответить
Shubham Biswas
Shubham Biswas - 26.07.2023 07:48

quiz answer:
x = int(input('enter 1st no'))
y = int(input('enter 2nd no'))
z = int(input('enter 3rd no'))
lis = [x,y,z]
print(max(lis))

Ответить
Komala Boddi
Komala Boddi - 24.07.2023 12:55

Anna teluga ahh..??

Ответить
innocent bamusi
innocent bamusi - 21.07.2023 11:59

powerful!

Ответить
pjcod47
pjcod47 - 09.07.2023 08:53

for assignment 1
x = int(input("enter no. "))
y = -0
if x == 0:
print("neutral int")
elif x < y:
print("negative int")
else:
print("positive int")

Ответить
SumanSalian
SumanSalian - 07.07.2023 22:26

1)Finding positive number.

X=-5
if X>0:
print("The given number is positive")
else:
print("The given number is negetive"print(" Enter 3 numbers of your choice\n")
---------------------------------------------------------------------------------------------------------------------------------------------
2)Finding largest number.

x=int(input(" enter first number: "))
y=int(input(" enter second number: "))
z=int(input(" enter third number: "))
if x>y:
if x>z:
print("greater number is: ",x)
elif y>x:
if y>z:
print("greater number is: ",y)
else:
print(" Greater number is: ",z)

Ответить
Dilip Reddy Dot
Dilip Reddy Dot - 22.06.2023 07:14

x = int(input('first value'))
y = int(input('second value'))
z = int(input('third value'))
if x > y and x > z:
print(x)
elif y > x and y > z:
print(y)
else:
print(z)

Ответить
akshatha acharya
akshatha acharya - 14.06.2023 17:46

The best tutor found on the internet for programming skills....

Ответить
Daljeet Singh Ranawat
Daljeet Singh Ranawat - 05.06.2023 18:29

thanks sir

Ответить
Arbitrary_Clicks & Pics
Arbitrary_Clicks & Pics - 22.05.2023 18:09

You are a very good teacher. Thank you Sir.

Ответить
Sunil Kulkarni
Sunil Kulkarni - 13.05.2023 19:57

x=int(input('enter first num'))
y=int(input('enter second num'))
z=int(input('enter third num'))
if x>y and y>z:
print('bigger number',x)
elif y>x and y>z:
print('biggr num',y)
elif z>y and z>x:
print('big num',z)

Ответить
Sunil Kulkarni
Sunil Kulkarni - 13.05.2023 19:48

i=int(input('enter a number'))
if i==0:
print("zero")
elif i<0:
print('negetive number')
else:
print('positive number')

Ответить
Prasan Na
Prasan Na - 20.04.2023 20:52

This was very well explained. Thank you.

Ответить
Pooja Upadhye
Pooja Upadhye - 17.04.2023 15:11

Hi .. I m new learner .. I don’t have any experience in coding or programming.. but I like to learn python .. my educational background is masters in physics .. I did some operations while doing projects.. but I wanted to chng my profession … I would like to learn data analysts … can anyone plz guid me for better learning excel, SQL

Ответить
Anil davu
Anil davu - 12.04.2023 16:35

Please suggest python book for beginners

Ответить
Vineth Sejan
Vineth Sejan - 09.04.2023 18:25

Thank you I have a good Understand About this lesson After your Great Explanation .

Ответить
2068 LOKESH M.C
2068 LOKESH M.C - 28.03.2023 15:00

Learning in 2023 it's just awesome u are making me to interest to learn

Ответить
Villain Sallu
Villain Sallu - 24.03.2023 20:57

Hi sir, I'm salman
I'm watching all videos of yours,
But this one i can't understand 😢

Ответить
Siddhant Raj
Siddhant Raj - 17.03.2023 11:04

x = int(input("Write any number"))
y = int(input("Write 2nd number"))
z = int(input("Write 3rd number"))
if x>y:
if x>z:
print("The greatest number is",x)
else:
print("The greatest number is",z)
else:
if y>z:
print("The greatest number is",y)
else:
print("The greatest number is",z)

Doing something by yourself feels soo goood...

Ответить
Priyansh Kumar
Priyansh Kumar - 09.03.2023 08:11

1)x = int(input('Enter a number:'))
if x>0:
print('the number is positive')
elif x<0:
print('the number is negative')
print('Bye ! Have a nice day')
2)x = int(input('Enter 1st number:'))
y = int(input('Enter 2nd number:'))
z = int(input('Enter 3rd number:'))
if(x>y and x>z):
print('1st number is greatest')
elif(x>y and x<z):
print('3rd number is greatest')
elif(x<y and y>z):
print('2nd number is greatest')
elif(x<y and y<z):
print('3rd number is greatest')
elif(x==y and x>z):
print('1st & 2nd numbers are equal and greatest')
elif(x==y and x<z):
print('1st & 2nd numbers are equal and 3rd number is greatest')
elif(x==z and x>y):
print('1st & 3rd numbers are equal and greatest')
elif(x==z and x<y):
print('1st & 3rd numbers are equal and 2nd number is greatest')
elif(y==z and x>z):
print('2nd & 3rd numbers are equal and 1st number is greatest')
elif(z==y and x<z):
print('1st & 2nd numbers are equal and greatest')
elif(x==y==z):
print('All three numbers are equal')
print('Bye !')

Ответить
Arun Kumar
Arun Kumar - 05.03.2023 11:19

solution for E1
x = -1

if x<0:
print("Given number is Negative")
elif x>=0:
print("Given number is Positive")

Ответить
Arun Kumar
Arun Kumar - 05.03.2023 11:16

solution for E2
num1 = int(input("Enter First Number1: "))
num2 = int(input("Enter First Number2: "))
num3 = int(input("Enter First Number3: "))

if num1 > num2 and num1 > num3:
print("Number1 is Greatest")
elif num2 > num1 and num2 > num3:
print("Number2 is Greatest")
else:
print("Number3 is Greatest")

Ответить
Advait Pisal
Advait Pisal - 19.02.2023 17:03

answer for q2 at the end of the video

x = float(input('enter a number 1'))
y = float(input('enter a number 1'))
z = float(input('enter a number 1'))
if (x > y) & (x > z):
print('the greatest is {}'.format(x))
elif (y > x) & (y > z):
print('the greatest is {}'.format(y))
elif (z > x) & (z > y):
print('the greatest is {}'.format(z))
elif (x == y == z)|(x == y)|(x ==z)|(y == z):
print('do not enter same values')

Ответить
Lochan Koundinya
Lochan Koundinya - 17.02.2023 22:12

The solution for assignment 1 is

x=int(input("enter the number :"))
if x<0:
print("negative number")
elif x==0:
print("constant")
else:
print("positive")

output:-
enter the number :5
positive

The solution for assignment 2 is

x=int(input("enter the 1st number :"))
y=int(input("enter the 2nd number :"))
z=int(input("enter the 3rd number :"))
if (x>y) and (x>z):
print("x is a greater number")
elif (y>x) and (y>z):
print("y is a greater number")
else:
print("z is a greater number")


output:-
enter the 1st number :7
enter the 2nd number :8
enter the 3rd number :6
y is a greater number

Ответить
Tech vinayak In telugu
Tech vinayak In telugu - 13.02.2023 17:08

thanks for the video

Ответить
Yash Chandwani
Yash Chandwani - 04.02.2023 19:20

You made it so easy! I could do the quiz questions in just 10 mins!
1. print("Let's check if a number is +ve or -ve.")
print()
x = int(input("Enter a number: "))

if x > 0:
print("You entered a positive number")
else:
print("You entered a negative number")
print("See you later!")

2. print("Let's check the highest of 3 numbers you give.")
print()

first_num = int(input("Enter the first number: "))
second_num = int(input("Enter the second number: "))
third_num = int(input("Enter the third number: "))

maximum = max(first_num, second_num, third_num)
print("Highest number is " + str(maximum))

Ответить
meaninglessnowadays
meaninglessnowadays - 02.02.2023 16:40

if number > 0:
print("Positive")
else:
print("Negative")
----------------------------------------------------------------
a = int(input("Enter the first number: "))
b = int(input("Enter the second number: "))
c = int(input("Enter the third number: "))

if a > b and a > c:
print(a, "is the greatest")
elif b > a and b > c:
print(b, "is the greatest")
else:
print(c, "is the greatest")

Ответить
aMIT rAJpUT
aMIT rAJpUT - 29.01.2023 07:09

Hey Navin, I am looking to change my career and I was looking for good mentor who can teach me programming in easy way and here I got your tutorials. Sorry at this moment I can't donate but I promise when I started earning from my my new career then sure I will. Also your tutorials are awesome
Adding to this I a just want to say I am not sure if I am right, when you did ifelse the number was 5 but it directly went to bye but didn't print "it's not great". Can you plz suggest this was right or wrong.
All the best for your new tutorials and God bless you

Ответить
akouiradjemou anis
akouiradjemou anis - 18.01.2023 18:38

a great tutorial with an excellent teacher, it was relly helpful^^

Ответить
ravi mittal
ravi mittal - 13.01.2023 10:54

Ans 1:

x = int(input(" enter any number :"))
if x>=0:
print ("The number is positive") # considering 0 a positive number
else:
print("The number is negative")


Ans 2(a):

x1, x2, x3 = int(input("enter 1st number")), int(input("enter 2nd number")), int(input("enter 3rd number")),
if x1 > x2 and x3: # without using max function
print("The max number is :",x1)
elif x2 > x3 and x1:
print("The max number is :",x2)
if x3 > x2 and x1:
print ("The max number is :",x3)

Ans 2(b):

x1, x2, x3 = int(input("enter 1st number")), int(input("enter 2nd number")), int(input("enter 3rd number"))

print( "The max number is :", max(x1, x2, x3))

Ответить
Piyush Shinde
Piyush Shinde - 02.01.2023 20:14

since 4 days i was confused between nested if and elif, now fully understood the difference between them .
Thank you so much sir!!🙏

Ответить
pulimi ashok
pulimi ashok - 22.12.2022 23:02

Worst explanation

Ответить
Saad Afzal
Saad Afzal - 17.12.2022 14:28

n = int(input("Enter a number"))
if n>0:
print("Number is positive")
elif n<0:
print("Number is negative")
else:
print("Wrong input")

n1 = int(input("Enter 1st Number"))
n2 = int(input("Enter 2nd Number"))
n3 = int(input("Enter 3rd Number"))

if n1>n2 and n1>n3:
print("1st number is greatest")
elif n2>n1 and n2>n3:
print("2nd number is greatest")
if n3 > n1 and n3 > n2:
print("1st number is greatest")

Ответить
satwik baruri
satwik baruri - 16.12.2022 10:07

Wow

Ответить
Harikrishna Yaragorla
Harikrishna Yaragorla - 14.12.2022 08:34

1.
a= values
if a>0:
print('positive')
else:
print("negative').

2.
a,b,c=5,8,11
if a>b and a>c:
print('a is highest')
if a<b and c<b:
print('b is highest')
if a<c and b<c:
print('c is highest')
print()

Ответить
bhavani sankar ALLAM
bhavani sankar ALLAM - 18.11.2022 12:24

print("Hello World")
n1 = 8
if n1 > 0:
print("Positive Number")
else:
print("Negitive Number")

n2 = int(input("Enter 1st Number: "))
n3 = int(input("Enter 2nd Number: "))
n4 = int(input("Enter 3rd Number: "))
if n2 > n3:
if n2 > n4:
print(n2)
elif n3 > n4:
print(n3)
else:
print(n4)

Ответить
Pankhudi Sharma
Pankhudi Sharma - 17.11.2022 17:03

missing IDLE🙂

Ответить
full maza entertainment
full maza entertainment - 02.11.2022 04:14

a = int(input("Enter first number"))
b = int(input("Enter second number"))
c = int(input("Enter third number"))

if a > b and a > c:
print(a)
elif b > a and b > c:
print(b)
elif c > a and c > b:
print(c)

Ответить