While loops in Python are easy ♾️

2024 ж. 13 Мам.
293 033 Рет қаралды

#python #tutorial #course
while loop = execute some code WHILE some condition remains true
00:00:00 intro
00:00:50 example 1
00:01:50 infinite loop
00:02:25 example 2
00:03:39 example 3
00:05:08 example 4
00:06:35 conclusion

Пікірлер
  • #while loop = perform some code WHILE some condition remains true # ---------------- EXAMPLE 1 ---------------- name = input("Enter your name: ") while name == "": print("You did not enter your name!") name = input("Enter your name: ") print(f"Hello {name}") # ---------------- EXAMPLE 2 ---------------- age = int(input("Enter your age: ")) while age < 0: print("Age can't be negative") age = int(input("Enter your age: ")) print(f"You are {age} years old") # ---------------- EXAMPLE 3 ---------------- food = input("Enter a food you like (q to quit): ") while not food == "q": print(f"You like {food}") food = input("Enter another food you like (q to quit): ") print("bye") # ---------------- EXAMPLE 4 ---------------- num = int(input("Enter a # between 1 - 10: ")) while num < 1 or num > 10: print(f"{num} is not valid") num = int(input("Enter a # between 1 - 10: ")) print(f"You picked the number {num}")

    @BroCodez@BroCodez Жыл бұрын
    • thank u soo much bro for the video as well as the code here☝

      @rm-vo5zu@rm-vo5zu Жыл бұрын
    • Thank you for your efforts 🤩!!

      @alexak8671@alexak8671 Жыл бұрын
  • You explained this so clearly. Easiest “while” video to understand for me thus far. Liked.

    @christopherbermudez1528@christopherbermudez1528 Жыл бұрын
    • This*

      @buenolvr@buenolvr Жыл бұрын
    • @@buenolvrthus is grammatically correct here

      @simonaubrey6326@simonaubrey632610 ай бұрын
    • @@buenolvr if it said this it would be incorrect. dafuq

      @iSwearToCod@iSwearToCod9 ай бұрын
  • Thank you very much, this is the first time I have actually completely understood how to implement a while loop without having to deal with infinite responses. Your video was great and helped a lot. Cheers

    @billalkhwaja851@billalkhwaja851 Жыл бұрын
  • This was the best explanation video so far that i found. And probably the best Coding based teaching YT I have came across.

    @pirunnyrkki518@pirunnyrkki5189 ай бұрын
  • Thank you so much for this video! I have been stuck on while loops for two days. I understand it so much more now. You rock!

    @saturncosmos@saturncosmos Жыл бұрын
    • are u a computer

      @buenolvr@buenolvr Жыл бұрын
    • ​@@buenolvr 😂

      @sparkcodez@sparkcodez11 ай бұрын
  • you are really a Bro for teaching us while loop and making it looks so easy thanks !

    @jiyonn9902@jiyonn9902 Жыл бұрын
  • Wow. Thats what I needed!!!! I am learning and learning loops and anyway can't understand how it's works. Maybe now I will. Thanks Bro! Now I need to find you video for for loop as well ;)

    @ssigitas69@ssigitas69 Жыл бұрын
  • Thank you for the easy and clear explanation! Loved it!

    @moniquebrasilbaptista1989@moniquebrasilbaptista1989 Жыл бұрын
  • Thanks! This has been the best and easiest tutorial for me to understand 👏 The explanation is quit simple and clear to the point. 🔥

    @Iskm.28@Iskm.285 ай бұрын
  • that explanation was so good I transcribed some of it for my notes verbatim!

    @LA-cy1zj@LA-cy1zj Жыл бұрын
  • I've been working on this from months and you made me understand in minutes 😍

    @dhruvaraj4704@dhruvaraj47047 ай бұрын
  • Thanks!! I stuck in while loop as well. Now I understand how it works.

    @focuz24@focuz24 Жыл бұрын
  • What an informative video!! I find this video super helpful with such clear explanations!! Thank yoou so much!

    @fluffypieee@fluffypieee5 ай бұрын
  • Following from Uganda , This is the best explanation have received . finally understood while loops

    @abdulserwanga6946@abdulserwanga69465 ай бұрын
  • Finally, an easy explanation! Thank you!

    @LilJollyJoker@LilJollyJoker6 ай бұрын
  • Thanks for the help, much better than coursera's courses, and their explanation on loops in general. Subscribed!

    @evan._.7436@evan._.74369 ай бұрын
  • Best Vid to understand the while Loop. Great job

    @lopexaaz.kitchen628@lopexaaz.kitchen6284 ай бұрын
  • man you explained this so clearly it makes me wonder why I’m having so much difficulty with it

    @crimsonphoenix8907@crimsonphoenix89072 ай бұрын
  • The best video to explain the while loop ever

    @anxures7412@anxures74128 ай бұрын
  • Such a good video!! Thank you so much for this tutorial it helped a lot.

    @Dragonis91@Dragonis919 ай бұрын
  • Thank you to help us improve our programing

    @senpaigt911@senpaigt911 Жыл бұрын
  • Thanks bro! You're helping me a lot

    @rhapsody1819@rhapsody1819 Жыл бұрын
  • simple yet very clear and easy to understand.. thank you so much

    @jameswilliam2072@jameswilliam20725 ай бұрын
  • Finally a video that explains it from scratch with easy examples rather than rocket science

    @CyberTronics@CyberTronics9 ай бұрын
  • bro, i love you. you literally did just saved me

    @MateusLima-iu5wc@MateusLima-iu5wcАй бұрын
  • This makes so much sense now. Thank you Bro Code.

    @DenshaOtoko2@DenshaOtoko26 ай бұрын
  • Thank you for the clear explanation 🤩!!

    @alexak8671@alexak8671 Жыл бұрын
  • Thank you! You're a great teacher!

    @jeshy9810@jeshy9810 Жыл бұрын
  • Bro, i just spend a lot of time searching how to exit a while loop with one key and did not finding anything that make some sense to me and you explained it in six minutes, thanks a lot!

    @adailsoncarlos3122@adailsoncarlos312217 күн бұрын
  • Beautiful! YOU ARE THE BEST!!!

    @Native_love@Native_love11 ай бұрын
  • You are one of the best tutor in youtube for Python tutorials.

    @bilal.rk09@bilal.rk09 Жыл бұрын
    • i can show u a toutoriaalalaalal

      @buenolvr@buenolvr Жыл бұрын
  • This is the best explanation ive had

    @joeprodebadezt217@joeprodebadezt2179 ай бұрын
  • I now understand while loops better after watching this thank you

    @MRCLEEN@MRCLEEN Жыл бұрын
  • You became my favourite coder and teacher💯❤️🤝😊

    @myeducationvlogs8483@myeducationvlogs8483 Жыл бұрын
    • its proggraming!!

      @josephaddae7598@josephaddae7598Ай бұрын
  • You made it so easy . Thanks bro ❤

    @dishant_7@dishant_724 күн бұрын
  • Big thank you for your excellent video!

    @Vronsky1997@Vronsky199710 ай бұрын
  • thanks for teaching me the WoW loop :)

    @lesclart@lesclart Жыл бұрын
  • BEST TUTORIAL EVER! THANK YOU SO MUCH MY EXAM IS TOMMOROW

    @vortback@vortback11 ай бұрын
  • You are doing a great work

    @cse-17akashkumar32@cse-17akashkumar32 Жыл бұрын
  • This was really an interesting video in term of learning python and whole the tutorial is really appreciated just for helping us giving detailed information........................................

    @golamkibriaofficial320@golamkibriaofficial3202 ай бұрын
  • Thank you very much now I'm learning data science course it will be more useful for me to understand the python programming language very easily

    @user-we7gq1zy4o@user-we7gq1zy4o4 ай бұрын
  • you are the only one in yt who explain correctly

    @serdanaksunger2942@serdanaksunger29424 ай бұрын
  • I'm not even learning python, this is just good programming explanation, thank you!

    @TheJGX20@TheJGX203 ай бұрын
  • This tutorial helped so much with understansding the for while loop

    @kaitlinespinal5300@kaitlinespinal53002 ай бұрын
  • I've been in tech studies for long time but now I came to fully understand how while loop works

    @vaibhavmalhotra4855@vaibhavmalhotra4855Ай бұрын
  • Thank you for making it simple.

    @amrhassan8137@amrhassan81374 ай бұрын
  • Thanks man!! It's a good explanation

    @cvreddy4574@cvreddy45742 ай бұрын
  • This is pretty fun, thanks!

    @affable.pebble@affable.pebble4 ай бұрын
  • Bro. Now this is bro code. You are a good teacher👌👌👌👌

    @CodeSyntax0101@CodeSyntax01015 ай бұрын
  • in love! finally i understand while !!

    @mirarzk222@mirarzk22211 ай бұрын
  • This was great thank you.

    @LovelyJordy@LovelyJordy7 ай бұрын
  • This was fu***king awesome and understandable thank you so much ❤

    @abdulmalikhakimi989@abdulmalikhakimi989 Жыл бұрын
  • thanks for making this easy to understand.

    @josetijerino5198@josetijerino519825 күн бұрын
  • thanks to you i undrstand this while loop thank you so much

    @mrrelm5949@mrrelm5949 Жыл бұрын
  • NICELU DONE BRO...❤

    @user-ly5we6xl4v@user-ly5we6xl4v6 ай бұрын
  • Thank you very much for doing this.

    @mari23ification@mari23ification2 ай бұрын
  • You are really a Master.

    @takeactions@takeactions Жыл бұрын
  • you saved some lives here

    @yns9407@yns94077 ай бұрын
  • Best Bro 😀

    @mayurkanth6987@mayurkanth6987 Жыл бұрын
  • good work bro!

    @Uberdurden@Uberdurden7 ай бұрын
  • thanks super helpful

    @GearheadModding@GearheadModding8 ай бұрын
  • I love you.. even this is not on Google.. thanks Bro Code

    @benevolentnkrumah4427@benevolentnkrumah4427 Жыл бұрын
  • Thanks, Bro! ... Subscription is on the way!

    @Poem_AI@Poem_AI8 ай бұрын
  • Thanks bro 🤜

    @ashishraj9850@ashishraj9850 Жыл бұрын
  • You explained soo clearly , i have a test tomorrow on this chapter and this video helped a lot , thankyou

    @HebaZainab-wg5dk@HebaZainab-wg5dk6 ай бұрын
    • good luck on your test. i got exam in jan coming up for coding in python.

      @bobbye8964@bobbye89646 ай бұрын
  • This vid was soo easy and fun thanks

    @dnzz453@dnzz453 Жыл бұрын
  • helpfull thanks :)

    @born2die841@born2die841 Жыл бұрын
  • this was easy thanks bro

    @TypicalVole2437@TypicalVole2437 Жыл бұрын
  • I've been finding it so difficult when it comes to while loops, you made this so easy thank you! But is it not necessary to use else: statement??

    @farahbaliki4680@farahbaliki4680 Жыл бұрын
    • Not necessarily. if a while loop exits due to the condition being false, the upcoming lines of code will be executed. Loops can either be exited with the while condition being false, or with the help of 'break' #example: i=1 while i in range(6): print(i) i+=1 if i==6: break else: print("no break") In this code, since break is used to exit the loop, the else statement doesn't get executed. but if the if block is commented out, you could see that it runs the else statement after the loop gets exited.

      @ashkira73@ashkira73 Жыл бұрын
  • you are awesome! thanks a lot!

    @Iamandrey@Iamandrey4 ай бұрын
  • Good one sir

    @ahmadrandhawa238@ahmadrandhawa238 Жыл бұрын
  • love you bro👾

    @abolfazlzare-xx7gw@abolfazlzare-xx7gw21 сағат бұрын
  • How can it be so easy!!! thanks a lot!

    @user-lt5ew6xx9w@user-lt5ew6xx9w7 ай бұрын
  • I finally understood while loops 🤣😄

    @anonymous-vu2vo@anonymous-vu2vo9 ай бұрын
  • awesome!!!! Thanks!!!!

    @vizcarraorozco4740@vizcarraorozco47405 ай бұрын
  • Bro code > You just earned my sub

    @Jerrymiah1@Jerrymiah1 Жыл бұрын
  • bro before ho definitely! 💪

    @theamithsingh@theamithsingh18 күн бұрын
  • Thanks man!!

    @omex469@omex4696 ай бұрын
  • thanks for making this video, name = input("Please enter your name and no symbols or number: ") while name.isalpha() == False: print("You have either enter a number or symbol in your name, please try again:") name = input("Please enter your name and no symbols or number: ") else: print(f"Hello there {name}, thank you for following instructions")

    @riccardoholder6378@riccardoholder637829 күн бұрын
  • Hello everyone I want to know what type of note is he using for python please

    @mesharifahad7479@mesharifahad74798 ай бұрын
  • Great 🎉

    @madhusudhanchinnala1986@madhusudhanchinnala1986 Жыл бұрын
  • thank u very much

    @youssefmarak1511@youssefmarak15117 ай бұрын
  • muuuch obliged

    @nikkukohan522@nikkukohan5229 ай бұрын
  • How would I use this in a def function?

    @Monkeytrix29@Monkeytrix29 Жыл бұрын
  • So basically for example one if the user does not input their name, the while loop will keep asking for the user name until the condition is true and print out hello to the user

    @NanaKwameAE@NanaKwameAE Жыл бұрын
    • if you put the command again of asking names

      @AbdulRaffayOfficial@AbdulRaffayOfficial8 ай бұрын
  • nice video❤

    @jwl796@jwl7964 ай бұрын
  • Great

    @hishamdebis9490@hishamdebis949025 күн бұрын
  • You need put this whole python videos to compilation so we know tools about python

    @Ghostlynotme445@Ghostlynotme4454 ай бұрын
  • thank u so much this video explained clear but can u help me explain why when i'm writing nested while not working ? please can u help please

    @Cp_elisha@Cp_elisha5 ай бұрын
  • Which code editor do you use?

    @KakashiHatake-xk9to@KakashiHatake-xk9to5 ай бұрын
  • you explained this 100000000000000000x better than the instructor on free code camp!! you rock!!!

    @omarlg1907@omarlg19079 ай бұрын
  • Great vid

    @Eastcoast_Rds@Eastcoast_Rds Жыл бұрын
  • Brocode is really a big bro❤

    @suyashpawar5873@suyashpawar58735 ай бұрын
  • Thanks a lot

    @shaswatachowdhury9032@shaswatachowdhury90323 ай бұрын
  • what is the use of f string ?

    @yaseenijaz1473@yaseenijaz147310 ай бұрын
  • How to rember everything in coding if i learn something new after a few weeks i'm alreading forgeting it

    @jbrdeblij@jbrdeblij5 ай бұрын
  • Try this---------------> age = int(input("Enter your age: ")) age = int(input("Enter your age: ")) while age < 0: print("Age can't be negative") age = int(input("Enter your age: ")) if age>100: print("Its not possible to live than that!") elif age

    @devilwatcher5766@devilwatcher5766 Жыл бұрын
  • Thank you

    @ZenZangetsu@ZenZangetsuАй бұрын
  • why do we use f? can you explain?

    @nothuman2915@nothuman291511 ай бұрын
  • What is an f string

    @PaninBoateng-ww5qu@PaninBoateng-ww5qu9 ай бұрын
KZhead