Yeah but isn't it a bad practice to use breaks to exit loops? Isn't the "correct" way setting up a exit condition within the loop (like int i < 3) that exits you instead?
I agree, its more efficient to use a while loop and a condition which I mention near at the end of the video. For this video, I was just introducing how the break works, but necessarily the best or only option.
This was exactly what I was looking for. Perfectly explained. Thank you so much!
I hve been searching for an explanation all over UA-cam urs was the precise solution and understanding to my problem. Thankyou
Thanks bro, I am a student and just started python and was doing a personal programming and your video helped a lot, thanks
Stuart Davey is that you 😭😭😭 this sounds like Davey can't lie.
Nice video. You deserved so many likes and subscribers. 👍👍 Keep it up. I’m one of your subscribers now
Thank you! This helps me a lot!
Yeah but isn't it a bad practice to use breaks to exit loops? Isn't the "correct" way setting up a exit condition within the loop (like int i < 3) that exits you instead?
I agree, its more efficient to use a while loop and a condition which I mention near at the end of the video. For this video, I was just introducing how the break works, but necessarily the best or only option.
Thanks bro
password = input("enter thr password : ")
for i in range(2):
if password != "python":
print ( "wrong password remain attemp ", 2-i)
password = input("enter thr password : ")
elif password =="python":
print('WELCOME')
break