The if-elif-else Statement in Python

Python Programming: The if-elif-else Statement in Python
Topics discussed:
1. Introduction to if-elif-else Statement.
2. WAP to test whether a number is divisible by 2 or 3 using the if-elif-else statement.
Python Programming Playlist: • Python Programming
Follow Neso Academy on Instagram: @nesoacademy (bit.ly/2XP63OE)
Contribute: www.nesoacademy.org/donate
Memberships: bit.ly/2U7YSPI
Books: www.nesoacademy.org/recommend...
Website ► www.nesoacademy.org/
Forum ► forum.nesoacademy.org/
Facebook ► goo.gl/Nt0PmB
Twitter ► / nesoacademy
Music:
Axol x Alex Skrindo - You [NCS Release]
#PythonByNeso #PythonProgramming #ifelifelseStatement

Пікірлер: 17

  • @kristinamwangekan2471
    @kristinamwangekan247110 ай бұрын

    Thank you...well explained

  • @daregamerboy2255
    @daregamerboy225510 ай бұрын

    Thank u for your effort sir 🙏

  • @Inte8ranD
    @Inte8ranD7 ай бұрын

    You are a great teacher, thank you very much... @Neso Academy

  • @shivamchakrawarti8262
    @shivamchakrawarti826210 ай бұрын

    Great lecture sir if it is possible then please upload these lectures per day so that we remain consistent..

  • @chandraj1053
    @chandraj10535 ай бұрын

    Good explanation sir

  • @zaki695
    @zaki69510 ай бұрын

    Thank you sir

  • @kajalHere-r1d
    @kajalHere-r1d2 күн бұрын

    thankyou for this ...

  • @jatin607
    @jatin60710 ай бұрын

    Sir why are you left the Java playlist incomplete. Sir you are making so much efforts to make the video and we students are also look for the content which is completed.kindly upload the remaining video of Java playlist

  • @studentgroup1017
    @studentgroup101710 ай бұрын

    Thank you for Amazing Python course, Tottle how many videos are there of this course. Please replay

  • @SushilaMeena-1804
    @SushilaMeena-180410 ай бұрын

    Today's i perform this code in my lab but I can't understand but now my concept clear😊😊

  • @MaTHNERVEs
    @MaTHNERVEs2 ай бұрын

    How can i get pdf of class. I need this. My exam is knocking doors

  • @GousyaShaik-bq3xy
    @GousyaShaik-bq3xy10 ай бұрын

    Happy teacher's day sir😅

  • @GitaAska-is6yz
    @GitaAska-is6yz3 ай бұрын

    Tutorial python tricks and modifications

  • @leealvin7671
    @leealvin767110 ай бұрын

    Let’s take n = 6 n = 6 if n % 2 == 0: print(“Number is divisible by 2”) elif n % 3 == 0: print(“Number is divisible by 3”) else: print(“Number is neither divisible by 2 nor 3”) print(“Done!”) The output will be: Number is divisible by 2 Done! Why is it though, even though 6 can also be divisible by 3 Reason: Since the first condition is satisfied, Python interpreter wouldn’t consider the second condition onwards and will continue after exiting the if-elif-else statement. Improvement: n = 6 if n % 2 == 0 & n % 3 == 0: print(“Number is divisible by 2 and 3”) elif n % 2 == 0: print(“Number is divisible by 2”) elif n % 3 == 0: print(“Number is divisible by 3”) else: print(“Number is neither divisible by 2 nor 3”) print(“Done!”) By adding a line of code, you may get the desired output Output: Number is divisible by 2 and 3 Done!

  • @doctorbongumusa1566

    @doctorbongumusa1566

    10 күн бұрын

    python does not allow & unless you use ("&") it will then identify it as a string but will result in a syntax error

  • @user-yv1vo7hi8z
    @user-yv1vo7hi8z5 ай бұрын

    Must run it 😂😅 print("Do you want to know what you were in a past life?") while True: a=input("enter 'yes' or 'no' to continue :") if a=="yes": print(" Chutiya thhe tum!") break elif a=="no": print(" toh bhaad mein jao phir! ") break else: print(" PLEASE ENTER ONLY 'yes' or 'no' ")

  • @DEWAAN-ud7ss
    @DEWAAN-ud7ss8 ай бұрын

    Thank you sir