while Loop with else in Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.พ. 2025
  • Python Programming: while Loop with else in Python
    Topics discussed:
    1. Introduction to while Loop with else.
    2. Use of while Loop with else.
    Python Programming Playlist: • Python Programming
    Follow Neso Academy on Instagram: @nesoacademy (bit.ly/2XP63OE)
    Contribute: www.nesoacadem...
    Memberships: bit.ly/2U7YSPI
    Books: www.nesoacadem...
    Website ► www.nesoacadem...
    Forum ► forum.nesoacad...
    Facebook ► goo.gl/Nt0PmB
    Twitter ► / nesoacademy
    Music:
    Axol x Alex Skrindo - You [NCS Release]
    #PythonByNeso #PythonProgramming #WhileLoopWithElse

ความคิดเห็น • 19

  • @yatinshekhar787
    @yatinshekhar787 ปีที่แล้ว

    Nice video sir, while else was confusing at first but understood it after I watched it multiple times. Thanks sir

  • @PremKumar.S-it8et
    @PremKumar.S-it8et ปีที่แล้ว +3

    Thank your for the video!
    I am currently learning in my college c++ and python from u

  • @HarsitVerma-yt2ce
    @HarsitVerma-yt2ce 5 หลายเดือนก่อน

    Best teacher i found on you tube ❤❤

  • @alisheik3076
    @alisheik3076 9 หลายเดือนก่อน +4

    Great explanation sir.. Take a bow..❤ I want to learn OOPS in python from you.. could you please make videos on it..

  • @Abhiksha23
    @Abhiksha23 หลายเดือนก่อน

    Great explanation sir .. Thank you sir

  • @venkatraman_padmanaban
    @venkatraman_padmanaban ปีที่แล้ว

    I have actually had the program question and tried to write my own code. Below is my code:
    fruits = ['orange','banana','mango','orange']
    i = 0
    length = len(fruits)
    temp = 0
    #print(length)
    while i < length:
    if fruits[i] == 'orange':
    temp = 1
    i += 1
    else:
    if temp == 0:
    print("Orange is not present in the list")
    else:
    print("Orange is present in the list")
    But, I was really amazed of seeing how while with else has reduce the lines of code and our pain too!!!
    Thank you very much for this useful content!

  • @kaneki3194
    @kaneki3194 ปีที่แล้ว +1

    Please notice me sir! I really love your explanation. You really elaborated kt clearly to the point that event a monkey like me ca understand. This video helped me understand about while loops and its concept. So I thank you

    • @ericsiboniso
      @ericsiboniso 11 หลายเดือนก่อน

      youre not a monkey . if you were you wouldnt have the strength to study python youre much more than that and youre smarter than you think

  • @NSHIMIYIMANAAMOS-yi9hs
    @NSHIMIYIMANAAMOS-yi9hs ปีที่แล้ว +1

    Thank you sir

  • @Abhiksha23
    @Abhiksha23 หลายเดือนก่อน

    sir please make videos on the python oops and DSA please

  • @tonykay07
    @tonykay07 ปีที่แล้ว

    When are you planing of making videos on Object Oriented Programing in Python
    Thank You

  • @tayyab.sheikh
    @tayyab.sheikh 7 หลายเดือนก่อน +2

    can't we write it like this:
    fruits = ['apple', 'banana', 'mango', 'strawberry', 'orange']
    while 'orange' in fruits:
    print ('Orange is available')
    break
    else:
    print ('Orange is not available!')

  • @isaacodunaike6978
    @isaacodunaike6978 5 หลายเดือนก่อน

    teacher what of using this way to solve the question?
    fruits = ["apple", "banana", "mango", "strawberry"]
    while "orange" in fruits:
    print(True)
    break
    else:
    print("False")

    • @C_HROLLO
      @C_HROLLO 4 หลายเดือนก่อน

      that's wrong

    • @C_HROLLO
      @C_HROLLO 4 หลายเดือนก่อน +1

      if you wanna search a element in a list you can use count method or use indexing
      fruits=["apple", "banana", "mango", "berry"]
      length=len(fruits)
      for i in range(0,length-1):
      if fruits[i]=="orange":
      print("true")
      break
      else:
      print(false)

  • @thirdeyegaming4310
    @thirdeyegaming4310 ปีที่แล้ว

    sir ekse aage ka video kha h sir ji
    plz upload this

  • @masteragentonly
    @masteragentonly ปีที่แล้ว

    First to watch, comment