While Loops in Python | Python Tutorial - Day #18

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.พ. 2025
  • Python is one of the most demanded programming languages in the job market. Surprisingly, it is equally easy to learn and master Python. This python tutorial for absolute beginners in Hindi series will focus on teaching you python concepts from the ground up.
    Access the Playlist: • Python for Beginners (...
    Link to the Repl: replit.com/@co...
    Join Replit the browser-based IDE used in this course - join.replit.co...
    ►Checkout my English channel here: / @programmingwithharry
    ►Instagram: codewithharry
    python, C, C++, Java, JavaScript and Other Cheetsheets [++]:
    Playlist: • Coding CheatSheets 🧾 b...
    ►Learn in One Video[++]:
    Python[15 Hr]: • Python Tutorial For Be...
    Python Advance[3.5 Hr]: • Python Programming Cou...
    Python[1 Hr]: • Learn Python In Hindi ...
    Python[2 Hr]: • Python Tutorial In Hin...
    Python[15 Min]: • 15 Minute Python Tutor...
    JavaScript[1 Hr]: • JavaScript Tutorial
    C[1.3 Hr]- • C Programming Tutorial...
    php[1 Hr]: • Learn Php In One Video...
    php[2.3 Hr]: • Php Tutorial for Begin...
    php[Project]- • Login And Registration...
    HTML[30 Min]: • HTML 5 Tutorial For Be...
    CSS[8.5 Hr]: • CSS Tutorial In Hindi ...
    CSS[1.4 Hr]: • CSS 3 Tutorial For Beg...
    Wordpress[3.2 Hr]: • How To Make a WordPres...
    Angular[2 Hr]: • Angular Tutorial in Hindi
    Java[2.3 Hr]: • Java tutorial in hindi 🔥
    Web Scraping[1 Hr]: • Web Scraping Tutorial ...
    MongoDB[2 Hr]: • MongoDb Tutorial For B...
    Numpy[1 Hr]: • Numpy Tutorial in Hindi
    Android Dev[12 Hr]- • Android Development Tu...
    Linux[1 Hr]: • Linux Tutorial For Beg...
    JQuery[1.1 Hr]: • jQuery Tutorial For Be...
    Git and GitHub[1.1 Hr]: • Git & GitHub Tutorial ...
    ►Complete course [playlist]:
    React: • React Js Tutorials in ...
    Python- • Python Tutorials For A...
    OOP Python- • Object Oriented Progra...
    Java: • Java Tutorials For Beg...
    JavaScript- • JavaScript Tutorials I...
    PHP- • PHP Tutorials in Hindi
    C- • C Language Tutorials I...
    C++- • C++ Tutorials In Hindi
    Git & GitHub- • Git and GitHub Tutoria...
    Android Dev- • Android Development Tu...
    Python GUI- • Python GUI: Tkinter Tu...
    Web Development- • Web Development Tutori...
    Python Django: • Python Django Tutorial...
    Projects Using HTML, CSS & Javascript- • Projects Using HTML, C...
    Data Structure and Algo: • Data Structures and Al...
    Follow Me On Social Media
    ►Website (created using Django Rest & Angular): www.codewithha...
    ►Facebook: / codewithharry
    ►Instagram: / codewithharry
    Twitter: / codewithharry
    Comment "#HarryBhai" if you read this 😉😉

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

  • @CodeWithHarry
    @CodeWithHarry  ปีที่แล้ว +64

    Code Backup Repository: github.com/CodeWithHarry/100-days-of-code-youtube

    • @DhruvSharma-x6l
      @DhruvSharma-x6l 11 หลายเดือนก่อน +1

      Day 18

    • @sumibalian
      @sumibalian 8 หลายเดือนก่อน +1

      Moye more

    • @Motivation-v2l8y
      @Motivation-v2l8y 12 วันที่ผ่านมา +1

      Control + c to control this

  • @ch4r4cter
    @ch4r4cter 2 ปีที่แล้ว +292

    I've 2 years of experience in python development. Even though I know a lot. I watch all of Harry bhai's videos and love the way he explains. Good job Harry Bhai 👍

    • @rajibsant9741
      @rajibsant9741 2 ปีที่แล้ว +2

      Love bhaai

    • @rajibsant9741
      @rajibsant9741 2 ปีที่แล้ว +12

      Help me sir how I start my journey
      I am 1st year it student
      After read any programing language I forget it
      🙏✊

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

      @@rajibsant9741 same here

    • @umerkhan-kv9gd
      @umerkhan-kv9gd 2 ปีที่แล้ว +5

      @@rajibsant9741 Mery bhai mene MBA kia hai or mein programing seekh raha hn jb mein seekh skta hn to ap mujh sy kafi choty ho apki picking power mery sy zyada hai practice zyada sy zyada karo or jxt ek programing language par focus karo

    • @rajibsant9741
      @rajibsant9741 2 ปีที่แล้ว +5

      @@umerkhan-kv9gd ok

  • @kidKrishkode
    @kidKrishkode 10 หลายเดือนก่อน +12

    9:13s, I heard this story for the second time, in the last video of Python. And yes I have also used this many times but in winters when I go to the mountains.Then I did it to warm up the computer. It helps to heat up many computers.👍🏻👍🏻👍🏻

  • @mariamhasan3733
    @mariamhasan3733 2 ปีที่แล้ว +118

    Day #18 done! The story of the ants was pretty interesting 😆

    • @DeepakKumar-mb2lw
      @DeepakKumar-mb2lw 10 หลายเดือนก่อน +1

      It has happened to my laptop a few times in June-July. 🤣🤣

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

      @@DeepakKumar-mb2lw what was on the laptop that made ants to come? 🤔

    • @DeepakKumar-mb2lw
      @DeepakKumar-mb2lw 4 หลายเดือนก่อน

      @@Sioslayer there was nothing but the my room was on top floor and because of summer 🌞 due to high temperature, room temperature was too hot 🥵 so ants usually get inside laptop 😔💻 and does even come out later 😭

  • @saugatnepal5956
    @saugatnepal5956 2 ปีที่แล้ว +13

    I was inconsistent for a few days but yesterday I covered all that up. And now i am all caught up. :)

  • @tripleseven7771
    @tripleseven7771 ปีที่แล้ว +22

    Truly commendable playlist, completely understood python.

  • @mihirtechneer4377
    @mihirtechneer4377 2 ปีที่แล้ว +42

    I am not from IT, 30 years exp in Maintenance department (Mechanical Engineering) I have learned coding Python from Harry ( as well others ! )... thanks Harry!

    • @rubabkhan7693
      @rubabkhan7693 2 ปีที่แล้ว

      so still what you do ?

    • @mechanosys
      @mechanosys 2 ปีที่แล้ว

      @RUBAB KHAN Working with manufacturing company.

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

      I am From mechanical engineering sir

    • @Amar-yaduvanshi23
      @Amar-yaduvanshi23 11 หลายเดือนก่อน

      Bro kya karna padega mechanical engineer ban ne ke liye

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

      @@Amar-yaduvanshi23 mechanical engineering ki exam pass karni padegi bhai🤣🤣🤣

  • @Bhuro333
    @Bhuro333 ปีที่แล้ว +31

    🤣🤣 Bhai, honestly, chitiya (ants) ka example bahot hi achcha that.. learning with fun.
    Hats off to you sir ji 🤠

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

      Is line ko comments per dhundne aya tha,,,Apka comment sa dil khush ho gaya,,,,

    • @Your_All_Movie_Explainer
      @Your_All_Movie_Explainer 6 หลายเดือนก่อน +1

      9:27 😂

  • @Vlogs_with_lifelesson
    @Vlogs_with_lifelesson 2 ปีที่แล้ว +6

    I have learned many things from and still I just want to learn more things from you whatever you teach us is the easiest way to make us understand that's why I love to watch your videos.

  • @ummi7292
    @ummi7292 ปีที่แล้ว +4

    hey ...that hack about getting rid of ants using a while loop ... ! truly genius bro !

  • @infodiff
    @infodiff 8 หลายเดือนก่อน +1

    I am doing 8=10 lectures easily daily. hope to finish in 10 days all 100 lectures. So interesting. Thak you Harry. I am a Professor Of Medicine. MD Medicine but i will make good use of this programming knowledge and have already made scripts to manage pt data, medical records, pharmacy etc using php n mysql. Now will try to do the same using python. jango and flask look daunting to me right now, but i am ready to work hard and dont get tired sitting n codign for 12-14 hrs daily. Just love it. Thanks for being such a good tacher n giving all this away for free. We r giving u a lot of yt watch hrs :D

  • @debasishbesra2901
    @debasishbesra2901 ปีที่แล้ว +22

    Day 4 of #100DaysOfCode. Today in this video 18, I learned about Python's while loops, which execute statements as long as a condition is true, and how to use else statements with them. I also explored emulating do-while loops using an infinite while loop and a break statement with an if condition, ensuring the loop body executes at least once.
    Thank You Harry Bhaiya.

  • @Kuch_Bhi-lets_explore_it
    @Kuch_Bhi-lets_explore_it 2 ปีที่แล้ว +9

    Day 18 Done 🔥🔥, Amazing video harry bhai the way you teach us we loved that Thank you so much for being our Harry Bhai & Teacher ❤❤🙌🙌

  • @parasdhaundiyal7706
    @parasdhaundiyal7706 2 ปีที่แล้ว +4

    Harry bhai you are great man❤️

  • @_tryn_
    @_tryn_ 2 ปีที่แล้ว +10

    Harry Sir, I'm right now in class 9th and i have extreme intrest in computers and i want to work for Google or Microsoft in the future, so i am learning web dev and python since class 8. I've made a fully functional chess ai in python on my own and a portfolio website. My question is, Is this the right time to do all this?

    • @BLazerrrr123
      @BLazerrrr123 2 ปีที่แล้ว +3

      yep bro me too starting at your age

    • @Ayush-mg6xw
      @Ayush-mg6xw ปีที่แล้ว +2

      Keep your mathematics really strong it will help you a lot

  • @TECHCHANNEL-v1n
    @TECHCHANNEL-v1n 11 วันที่ผ่านมา

    such a good method of teaching.I don't know i directly understand the programme syntax

  • @prathamveerrajput7250
    @prathamveerrajput7250 2 ปีที่แล้ว +5

    Thank you Harry Bhai for these videos. It really help me alot

  • @Footballmoment1209
    @Footballmoment1209 6 วันที่ผ่านมา

    Respected Harry Sir, please never stop coding, doing TH-cam videos, bcoz you are God for us..God bless you sir..

  • @muhammadyaqoob9129
    @muhammadyaqoob9129 2 ปีที่แล้ว +7

    With the break statement we can stop the loop even if the while condition is true
    With the continue statement we can stop the current iteration, and continue with the next
    With the else statement we can run a block of code once when the while condition no longer is true

  • @aparajita30
    @aparajita30 ปีที่แล้ว +2

    10:33
    Else statement will execute because -5 is less than 0

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

    Dude, your teaching is brilliant. Talking about something else I really enjoy the way you say "bahut" 😂. It has stuck in my mind and now I also say it the same way 😄

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

    bhot easy kr diya h apne learning hamare liye thank you so much for helping us......😇

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

    do..while is a loop in which a set of instructions will execute at least once (irrespective of the condition) and then the repetition of loop's body will depend on the condition passed at the end of the while loop. It is also known as an exit-controlled loop.

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

    One could be an excellent programmer but that doesnt mean he will be a good teacher as well.
    Harry bhai has both the skills which makes him an extra ordinary teacher, keep up the good work!!!.

  • @happyrawat-x8s
    @happyrawat-x8s 11 หลายเดือนก่อน +2

    amazing harry bhai

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

    Harry sir! Great love from Pakistan ❤

  • @YessajiRao
    @YessajiRao ปีที่แล้ว +3

    In case of decrementing while loop where we don't need to print 0 we can simply write ---
    while i :
    print(i)
    i = i-1
    in case of C,we could write
    while(i--){
    printf("%d",i);
    }
    Given we need to initialize i as 6 instead of 5

  • @NeetuRuhela-e1k
    @NeetuRuhela-e1k 5 หลายเดือนก่อน

    Thanks for this ultimate course ❤❤

  • @Nasibullah12
    @Nasibullah12 ปีที่แล้ว +2

    Following is an example of using combination of while loop and break statement as do while loop in python.
    i = 10
    while (True):
    print(i)
    i = i+1
    if i>10:
    break

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

    LOVE YOU HARRY BHAI❤

  • @ShraddhaKushwaha-ms5wo
    @ShraddhaKushwaha-ms5wo 9 หลายเดือนก่อน

    harry yrr You are teaching very well.

  • @man_united-z1h
    @man_united-z1h 8 หลายเดือนก่อน +2

    Day 18 done ✅

  • @amitranjeetjha1240
    @amitranjeetjha1240 2 ปีที่แล้ว +2

    This course is awesome 🔥🔥

  • @Om-pant02
    @Om-pant02 2 ปีที่แล้ว +7

    Harry bhai please make a detailed Android course series like this. btw gr8 content & love you 💖❤️

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

    Thank you sir ❤️❤️

  • @mr.nobody.r2
    @mr.nobody.r2 ปีที่แล้ว

    # table
    Number = int(input("Enter number"))
    i=1
    while i

  • @sohailnawaz186
    @sohailnawaz186 ปีที่แล้ว +2

    in while loop, always give a variable first,
    second give a condition which is true at the start of the loop,
    third put the command in the loop,
    fourth within the loop convert the condition into false.

  • @anonymous____________________4
    @anonymous____________________4 2 ปีที่แล้ว

    Pranam bhrata 🙏 apka bahutt baht dhanyawad ❤️😌🙏😇

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

    Thank you for free python course

  • @DrRitul
    @DrRitul 2 ปีที่แล้ว

    i wrote this program with for loop it can print any table of number input by user
    intro = " Table Writer Program "
    print(intro.center(50, "*"))
    n = int(input("Enter NUmber: "))
    for i in range(n, 11*n, n):
    print(i)

    • @VnM-vm3wm
      @VnM-vm3wm ปีที่แล้ว

      print ("Table Writer Program".center(50, "*"))
      n = int(input("enter bich: "))
      for i in range(11):
      print ( n , "x" , i, "=", n * i )

  • @AmanKumar-vm4ez
    @AmanKumar-vm4ez 2 ปีที่แล้ว +1

    Good evening sir thank you for this video

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

    Day - 18 Completed😍

  • @amitkhare610
    @amitkhare610 ปีที่แล้ว +4

    print("""Do you want to use calculator?
    Press 1 to 9 for YES
    Press 0 for NO""")
    a = int(input())
    while a:
    welcome = "welcome to calculator world"
    print(welcome.title())
    a = int(input("Enter the first number: "))
    b = int(input("Enter the Second number: "))
    x = int(input("""1. Enter 1 for add
    2. Enter 2 for Sub
    3. Enter 3 for Div
    4. Enter 4 for Mul
    """))
    match x:
    case 1:
    c = a + b
    print ("Add is: ", c)
    case 2:
    c = a - b
    print ("Sub is: ", c)
    case 3:
    c = a / b
    print ("Div is: ", c)
    case 4:
    c = a * b
    print ("Mul is: ", c)
    case _:
    print("Enter the correct option")
    print("""Still do you want to use calculator?
    Press 1 to 9 for YES
    Press 0 for NO""")
    a = int(input())
    else:
    print("I respect your decision")

  • @melophilexmusic9010
    @melophilexmusic9010 11 หลายเดือนก่อน +3

    Par harry bhai 98 to 38 se greater tha to condition false hui to direct done with the loop print hona chahiye tha na instead of printing i also???

    • @ramsita1111
      @ramsita1111 11 หลายเดือนก่อน +2

      Same question

    • @SaiGamer24
      @SaiGamer24 10 หลายเดือนก่อน +1

      Bro itna observation skill hai toh aap ye computer programing kyu kar rahe ho detective ban jao

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

      bro program dekho user input lene ke directly baad print(i) hai fhir loop ke bahar aata hai toh pehle print hoga fir condition check karega ki condition true hai ya nahi

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

    while True:
    number = int(input("enter the value of number:= "))
    print(number)
    if not number > 10:
    break;

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

    @CodeWithHarry agar aapne value count= count-1 agar 5 dali to else execute hoga bro

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

    9:01 lol...CodeWithHarry and the ant wars🤣😂

  • @asadurrehman3591
    @asadurrehman3591 2 ปีที่แล้ว +7

    answers=['east','islamabad']
    q1=input('where does the sun rises= ')
    q2 = input('what is the capital of pakistan= ')
    prize=100
    while q1 in answers and q2 in answers:
    print('Both answers are right and you wont',prize*2)
    break
    while q1 in answers and q2 not in answers:
    print('one is right and one wrong so you won ',prize)
    break
    while q1 not in answers and q2 in answers:
    print('one is right and one wrong so you won ',prize)
    break
    while q1 not in answers and q2 not in answers:
    print('Both the answers are wrong so you won ',prize*0)
    break

  • @khizrshaikh9902
    @khizrshaikh9902 2 ปีที่แล้ว

    10:27
    Yes
    Else block will definitely execute

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

    DOUBT🚨🚨🚨 5:35 why did the 'i' get printed? it was inside the 'while' function so it shouldn't have been printed right?

  • @thatcoolkid370
    @thatcoolkid370 2 ปีที่แล้ว +41

    #Day 18 in 100DaysOfCode. Maintaining consistency is a difficult thing.

  • @rufussunu9044
    @rufussunu9044 2 ปีที่แล้ว

    Your videos are awesome 😎

  • @ikramkhan10147
    @ikramkhan10147 2 ปีที่แล้ว

    Thanks
    🤩🤩🤩

  • @user-og2lt8ou8i
    @user-og2lt8ou8i ปีที่แล้ว +1

    once we created a variable named "coun"t outside while loop and stored a integer and then how we can redefine the same named-variable as in this case count=count-1 again redefined.
    I didn't understand this thing.
    please help someone..

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

    i=0
    while(i

  • @riteshsrivastava2030
    @riteshsrivastava2030 2 ปีที่แล้ว +4

    I hav a doubt plz solve
    Ques.- Write a program to display all the integers from 1 up to and including some integer entered by the user followed by a list of each number's prime factors. Number greater than 1 that only have a single factor will be marked as prime.
    For example, if the user enter 10 then the output of the program should be :
    Enter the maximum value to display : 10
    1=1
    2=2 (prime)
    3=3(prime)
    4=2*2
    5=5(prime)
    6=2*3
    7=7(prime)
    8=2*2*2
    9=3*3
    10=2*5

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

      Interesting question
      Wait I'll try this after I'm done with watching the video

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

      Well it's easy
      You can 1st take the user input and store it in a variable , say n
      Then use the for loop with 1 as the start value and n as your step value
      Further , inside the for loop , you can use the if-else statement
      In the if part , you can check if it's prime or not & then write a print statement according to what you want as the output

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

      But it will be better if you define a function already for the prime number and then check it , it will save your time also & will help you while writing down the factors :)

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

      @@nanhakachua863 problem in checking prime no.?😔🤔

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

      And also how i will factor them

  • @rubabkhan7693
    @rubabkhan7693 2 ปีที่แล้ว

    aapky is new course se mujhy loops samah ay hen purane se nhi arahe the 😂shukar hai mai bhi loop kr k aapki video p hi aaya

  • @NEERAJ-dw9bt
    @NEERAJ-dw9bt ปีที่แล้ว +1

    Present sir 🤚

  • @MyID.N
    @MyID.N 11 หลายเดือนก่อน +3

    @CodeWithHarry bro, I am new to programming and here is what I did to print the table of 3
    i = 0
    k = 0
    while i < 32:
    while k < 11:
    print("3 * ", k ,"=" ,i)
    i= i+3
    k= k+1

    • @APOBANGO
      @APOBANGO 10 หลายเดือนก่อน +1

      yeah that is right but you can do it in easier by by using for loop like this
      print("The table of 3 is:-
      ")
      k=1
      for i in range(3,30+1,3):
      print("3 *",k,"= ",i)
      k=k+1

    • @Mr.Phantom001
      @Mr.Phantom001 10 หลายเดือนก่อน +1

      # number multiplication order program till 10:
      a = 1
      b = int(input("enter number :"))
      while (a < 11):
      print(a,"*",b,"=",a*b)
      a = a + 1

  • @ManishKumar-ol8tu
    @ManishKumar-ol8tu ปีที่แล้ว

    if we will use else in while loop else will be executed whether it enters while loop or not.

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

    10:04 , else statement tb execute karta hai jab loop me break statement nahi ho, agar only statement he print karna hai toh normal be toh likh sakte hai...

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

    2 din me 18 video nipta diya mene with making notes and program, tabhi course h aapka 😍😍😍

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

    Thank you for this course

  • @dhuruvm
    @dhuruvm 2 ปีที่แล้ว

    Thank you harry Bhai 💞💞💞💞💞💞💞💞💞

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

    The loop starst from 1 then it prints the 3 number and it leaves the third number and prints 4 ,likewise it iterates every third number between 1 to 12

  • @prakashmishra8849
    @prakashmishra8849 2 ปีที่แล้ว

    Your video is very helpfull for me

  • @victorb22622
    @victorb22622 9 หลายเดือนก่อน +1

    12:47 do while loop मतलब पहले इस्तेमाल करो फिर,,,,, ।first you do ,then the confition ,if condition not match then dont do

  • @narullah69
    @narullah69 2 ปีที่แล้ว +2

    what an intelligence of harry bhai #ants_around_harry's_laptop 😂😂

  • @AnilKumar-dt7ns
    @AnilKumar-dt7ns 2 หลายเดือนก่อน

    good explanation

  • @krishankaushik4800
    @krishankaushik4800 2 ปีที่แล้ว

    Thank you bhai for your love and support towards us. 🥰🥰

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

    Harry Bhai Core Java k course le ke aao ek vedio banado... Wipro training period m sikhne ko bola h project m lgenge Java.. but study source nhi mil rha koi acha... Tum banado plz bhaiya next week m 😊❤️

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

    for loop in range(4):
    print(2)
    a=int(input("ENTER YOUR NUMBER HERE: "))
    while (a

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

    number = int(input("Enter a positive number: "))
    while True:
    print(number)
    if not number > 0:
    break
    is this correct?

  • @AtifMalik-g3b
    @AtifMalik-g3b หลายเดือนก่อน

    #Emulation of do while loop in python
    i = 100
    while 1:
    print("Hi",i)
    i+=1
    if i>90:
    break
    13:36
    So basically this program is emulation of do while loop. it runs at least one time even if the exit condition is false
    In python there's no do while loop. So we can create it by creating an infinite loop in which well write one exit condition by using if statement if that condition met then we'll use break statement to come out of loop.
    So in above program if i>90 then loop will be terminated. I have taken i = 100. Even then loop will run one time and then it will be terminated.

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

    10:35 Else execute hoga kyuki wo loop sae bahar ayega

  • @Psyduck_ff18
    @Psyduck_ff18 2 ปีที่แล้ว

    Great ❤️‍🔥❤️‍🔥

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

    Instead of writing, count = count + 1/ count = count - 1
    we could also write count +=1/ count -=1
    #it basically means the same thing, its just an easier way of writing it.🤗

  • @arohi_303
    @arohi_303 5 หลายเดือนก่อน +2

    Day 18✨

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

      hi what's your class level?

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

      @@nirrawal5265 11th

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

      ​@@nirrawal5265 11th

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

    Boss I came back to this video for revision. One thing I really want to know is what is the shortcut Key u r using after selecting a chuck of code and commenting it out with a single button? Thank you

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

    num = int(input("Enter a number (greater than 0) : "))
    getName = input("Enter your name : ")
    for num in range(num):
    if(num%2==0):
    print("Hi", getName)
    else:
    print("I Love You💝!")

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

    Present Sir , #Day_18

  • @masumhaither6077
    @masumhaither6077 2 หลายเดือนก่อน +1

    print(" guess the number game")
    print(" between (1-20)")
    your_friendnum = int(input("enter a number for your friernd in order to play between 1-20 (dont show them🤫): "))
    num = int(input("enter a number: "))
    while(num != your_friendnum):
    num = int(input("guess the number again😛: "))
    if num == your_friendnum :
    print("you guessed it right!!!!!🤩")
    elif num == your_friendnum-1 :
    print("you are close😏")
    elif num == your_friendnum+1 :
    print("you are close")

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

      a simple game made by a 12 years old.(duh!🙄)

  • @sarvjeetsuryaa5290
    @sarvjeetsuryaa5290 2 ปีที่แล้ว

    yes sir else is executed because the loop is out or its output is false

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

    Present Sir 🤞

  • @aparnasoni522
    @aparnasoni522 2 ปีที่แล้ว

    You r awesome mere bhai😘😘

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

    Break is a termination of loop
    Continue is a skip current execution

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

    clg ki chitiya wali story is evergreen , in every loop video of harry🤣😂

  • @thechillstation4492
    @thechillstation4492 ปีที่แล้ว +2

    day 18, things are getting difficult, slowly but definitely, hope i get through these 100 days

  • @akhtaralamkhan6837
    @akhtaralamkhan6837 2 ปีที่แล้ว

    Ustad ji♥️♥️

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

    Sir i am in 11 and doing python and u r awsome

  • @ajaynegi1753
    @ajaynegi1753 2 ปีที่แล้ว

    Hi, finally i have covered all past videos.

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

    a=int(input("enter any no yoy want to make table="))
    b=1
    print("this is your table")
    while(b

  • @Coding-gn2rl
    @Coding-gn2rl 8 หลายเดือนก่อน

    Sir i have a doubt...
    If the condition in while loop is wrong, it is executed once and then end the loop. Why it executes once??
    Why don't it just exit from the loop??

  • @shubhamsharma4336
    @shubhamsharma4336 2 ปีที่แล้ว +2

    question - how to emulate a do-while loop in python
    ans -
    while True:
    number = int(input("Enter a positive number :
    "))
    print(number)
    if not number > 0:
    break
    print("done with emulation")

    • @coder-vq7it
      @coder-vq7it ปีที่แล้ว

      Bhai tera code tab tak chalta rahega jab tak negetive value nahi dalega tho kya fayda?

    • @coder-vq7it
      @coder-vq7it ปีที่แล้ว

      But well try though👍

  • @Vlogs_with_lifelesson
    @Vlogs_with_lifelesson 2 ปีที่แล้ว

    The else condition will also print along with while loop

  • @PranavLal-yw1yk
    @PranavLal-yw1yk 29 วันที่ผ่านมา

    Thx

  • @optimusgaming2142
    @optimusgaming2142 2 ปีที่แล้ว

    Thank you for your support sir

  • @chaitanya-n2y
    @chaitanya-n2y 8 หลายเดือนก่อน +1

    My practice solution
    #Decrementing while loop
    i = 5
    while (i > 0):
    print(i)
    i = i -1
    else:
    print("Happy New Year")
    #Increment while loop
    y = 1
    while (y 0:
    break

  • @learnscienceinassamese
    @learnscienceinassamese 2 ปีที่แล้ว

    i am a beginer in programimg , you alredy maked a tutorial playsilt , which one will i
    compleate frist

  • @computer__sci
    @computer__sci 2 ปีที่แล้ว

    while loop ka is sai best use mene aaj tak nahi dekha