For loops in Python are easy 🔁

  Рет қаралды 241,513

Bro Code

Bro Code

Күн бұрын

#python #course #tutorial
00:00:00 iterate forwards
00:01:39 iterate backwards
00:02:15 step
00:02:44 iterate over a string
00:03:26 continue
00:04:19 break
00:04:35 conclusion
for loops = execute a block of code a fixed number of times.
You can iterate over a range, string, sequence, etc.
--------------- EXAMPLE 1 ---------------
for x in range(1, 11):
print(x)
--------------- EXAMPLE 2 ---------------
for x in reversed(range(1, 11)):
print(x)
print("Happy New Year!")
--------------- EXAMPLE 3 ---------------
for x in range(1, 11, 2):
print(x)
--------------- EXAMPLE 4 ---------------
credit_card = "1234-5678-9012-3456"
for x in credit_card:
print(x)
--------------- CONTINUE ---------------
for x in range(1, 21):
if x == 13:
continue
else:
print(x)
--------------- BREAK ---------------
for x in range(1, 21):
if x == 13:
break
else:
print(x)

Пікірлер: 91
@BroCodez
@BroCodez Жыл бұрын
# for loops = execute a block of code a fixed number of times. # You can iterate over a range, string, sequence, etc. # ---------------- EXAMPLE 1 ---------------- for x in range(1, 11): print(x) # ---------------- EXAMPLE 2 ---------------- for x in reversed(range(1, 11)): print(x) print("Happy New Year!") # ---------------- EXAMPLE 3 ---------------- for x in range(1, 11, 2): print(x) # ---------------- EXAMPLE 4 ---------------- credit_card = "1234-5678-9012-3456" for x in credit_card: print(x) # ---------------- CONTINUE ---------------- for x in range(1, 21): if x == 13: continue else: print(x) # ---------------- BREAK ---------------- for x in range(1, 21): if x == 13: break else: print(x)
@doober.43
@doober.43 Жыл бұрын
hi
@relentlesshvh
@relentlesshvh Жыл бұрын
Hey bro, I don’t know if you would have the time to do this. But PLEASE could you do a lua guide from scratch. There are barley any tutorials on YT. And none of them are very good. All I ask is just for around an hour course. But more would be a bonus
@ShivamKumar-rz7uv
@ShivamKumar-rz7uv 8 ай бұрын
bro code -- range star pattern !!!!
@Qtaroo
@Qtaroo Жыл бұрын
You got me into programming
@droneit7961
@droneit7961 5 күн бұрын
are you still in programming?
@Qtaroo
@Qtaroo 5 күн бұрын
@@droneit7961 i still am but i stopped for months because i have a final exam and i’ll finally graduate ;))
@En1gma2u
@En1gma2u 8 ай бұрын
Best explanation and easy to understand. Thank you!!
@JamalDid
@JamalDid 5 ай бұрын
Keep up the good work! You helped me out and now i understand more and better! Thank you
@stanislawignacy
@stanislawignacy 9 ай бұрын
bro that's even better than yout 12-hour tutorial piece. I had a small doubts how range can be iterated but now I understand it!
@NanaKwameAE
@NanaKwameAE Жыл бұрын
Welp that made my understanding more clearer, at first I was on a course learning for loops and implementing it Into real situations like a website or software and I was confused but once I saw this it made the understanding of it easier thank you
@SerapioSergiovich
@SerapioSergiovich 22 күн бұрын
Nice video shows methods to create a business..
@Draurore
@Draurore 4 ай бұрын
i just need to say thank you, i have a programming exam tomorrow and your videos are saving my life
@ZenZangetsu
@ZenZangetsu 2 ай бұрын
This stuff was confusing in my course and in my book. This really helped clear up some confusion. Thanks man!
@senpaigt911
@senpaigt911 Жыл бұрын
This episode is really interesting, keep it up!
@adamartinmusic
@adamartinmusic 3 ай бұрын
thank you so much for helping. i understand you so well.
@rebeccabreez8928
@rebeccabreez8928 8 ай бұрын
i your videos just clear all my doughts . arigato gozaimasu !!
@SavageScientist
@SavageScientist Жыл бұрын
great examples
@jwl796
@jwl796 4 ай бұрын
nice course❤
@user-ly5we6xl4v
@user-ly5we6xl4v 6 ай бұрын
NICELY DONE...❤
@ghusandgamin
@ghusandgamin Жыл бұрын
That was helpful Thanks 🙏🙏
@Dev_bhog
@Dev_bhog Жыл бұрын
thank you i had watched alot of videos and couldnt understand, yet i understand now good day.
@rajakm7544
@rajakm7544 11 ай бұрын
very useful
@GTV_367
@GTV_367 10 ай бұрын
Good vids bro🤞🏽
@SukreLopezBeats
@SukreLopezBeats 2 ай бұрын
High quality content. You win me as a subscriber.
@edikblank3759
@edikblank3759 Жыл бұрын
biggest gigachad because: A) Amazing tutorial B) Said tutorial is absolutely free C) Flat out refuses donations and says no give to a charity D) Has the gigachad picture in his pfp
@GVSdude20
@GVSdude20 16 күн бұрын
bro you helped me with my coding project with this tutorial! Thankyou
@sameerjain9174
@sameerjain9174 Жыл бұрын
Bro you are the best guy for programming
@karnikkumarsingh
@karnikkumarsingh 2 ай бұрын
I was first confused at coding but ur explanation is marvelous i like how you teach programming
@Animefan8050
@Animefan8050 Ай бұрын
One of the best tutorials I've seen. I am learning Godot (whose programming language is extremely similar to Python) and this has cleared up a lot! Will subscribe for more. You explained in a way many dont. What's the function? How can you use the function? What's a practical example? You did all of that, nicely done.
@Bosy99616
@Bosy99616 4 ай бұрын
bro, you're my hero
@user-dj7ic1xs2p
@user-dj7ic1xs2p 10 ай бұрын
what a nice video
@morpheus_circuit
@morpheus_circuit 5 ай бұрын
Once again great tutorial Bro Code
@varshinisekhar4857
@varshinisekhar4857 Жыл бұрын
you are awesome 🤩
@Rawman_56
@Rawman_56 9 ай бұрын
You are awesome
@mo-ab7315
@mo-ab7315 Жыл бұрын
tutorials are so goated
@HsuMonMonThant
@HsuMonMonThant Жыл бұрын
Thank u so much bro Congratulation for 1M subscribers🥳
@IlIIllIlIlIIlIlIlIlIIl
@IlIIllIlIlIIlIlIlIlIIl Ай бұрын
your the best =))
@blucky983
@blucky983 Жыл бұрын
Thanks bro
@AmanNgmOP
@AmanNgmOP Жыл бұрын
Can you guys imagine this legend made me master in python, and in school, students of my grade are just learning simple things of python
@fustt2426
@fustt2426 11 ай бұрын
great
@moniquebrasilbaptista1989
@moniquebrasilbaptista1989 Жыл бұрын
Thank you
@abdulwahidhamidy6909
@abdulwahidhamidy6909 4 ай бұрын
Thanks
@pedicle5509
@pedicle5509 7 ай бұрын
Thank you :)
@user-dz4uu2dr9p
@user-dz4uu2dr9p 3 ай бұрын
love u bro u make me to understand ❤❤❤❤
@ramial_rashid4440
@ramial_rashid4440 4 ай бұрын
thx
@tara2337
@tara2337 3 ай бұрын
you rock Bro!
@Cruzfire10
@Cruzfire10 8 ай бұрын
Thank you Benson Adventure Time!
@bigfly4167
@bigfly4167 Ай бұрын
What extension pack are you using to get you VS code layout to look like that?
@farhanbinsufian7233
@farhanbinsufian7233 4 ай бұрын
His videos forces me to think why people even buy paid course. It isn't even like he doesn't incorporate other misc. important stuff aswell. Keep going on Bro!
@user-vn7ip5kp7j
@user-vn7ip5kp7j Жыл бұрын
can you please make data structure algorithm course for C++? Please!!!!
@Vivek_xkt
@Vivek_xkt Жыл бұрын
Hey bro I have a doubt . It's from python Gui windows. You told us how to create a new window by clicking a button . My problem is when we created a new window, then How can I get the strings value from Entry boxes in the newly created window?!?! I am stuck in this problem from last 20hrs please help . I can use the get method for Entry boxes in 1st window but after creating 2nd window i am unable to use the get method on the entry boxes of window 2 :(
@DIYRobotGirl
@DIYRobotGirl 7 ай бұрын
But can we do that is a set of arrays with timer or wait time in millis and make the different arrays do different things from one another? 😮
@pjm3005
@pjm3005 7 ай бұрын
i'm pretty sure the for loop executes faster than the while loop too.
@imhere3445
@imhere3445 2 ай бұрын
Hey question. Im learning how to code with Crunchzilla and I’m trying to get the answer for a specific question which the internet doesn’t answer. In code monster that im using forloop is used too repeat code to make boxes c.fillRect. So they use this code:(i=0; i
@MassMen
@MassMen 26 күн бұрын
Can you tell me how you have two screens
@vividdaydream1516
@vividdaydream1516 3 ай бұрын
Okay, so a "for" loop is sort of a countdown or timer?
@yunishmanandhar4817
@yunishmanandhar4817 8 ай бұрын
hey whats an itiration i need some simple definiton
@rayforever
@rayforever Жыл бұрын
MERN app development? I am having trouble with npm cuz they loads too much files Can you make course on how to set up mern app development
@rayforever
@rayforever Жыл бұрын
Proud to be 5th commenter
@bruhhh.77
@bruhhh.77 9 ай бұрын
I fkin love you
@kundankumar8467
@kundankumar8467 Жыл бұрын
Heyy , Can you upload Full stack MERN web development course ?? Please 🥺
@diegooo0725
@diegooo0725 10 ай бұрын
i didn´t understand this thank you
@javierchavarria1386
@javierchavarria1386 Жыл бұрын
what IDE are you using?
@BallzRolls
@BallzRolls 11 ай бұрын
its pycharm
@tawilk
@tawilk Жыл бұрын
question: if I have a directory with a different number of items in each, how can I loop to access each item from 1st item to last/max item?
@Arsen_winning_way
@Arsen_winning_way Жыл бұрын
maybe you can use a [for item in 'name of the directory']
@tawilk
@tawilk Жыл бұрын
@@Arsen_winning_way I ended up using - len(file_paths) - to determine the number, then created a range with len being the max and looped it with a file position command.
@abdulhannan-18
@abdulhannan-18 7 ай бұрын
break: breaks the loop at that iteration for x in range(1, 21): if x == 18: break print(x, end=' ') 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 for x in range(20): if x == 18: break print(x, end=' ') 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
@ChewwyPew
@ChewwyPew 4 ай бұрын
So if we want to use for loop on a list, do we turn the list into strings with .str() after the list
@Lithium50
@Lithium50 4 ай бұрын
To turn a list into a string you use: newString = "".join(your_list)
@Ndujlz
@Ndujlz 4 ай бұрын
yes just go like this cars = ("Mercedes", "Audi", "BMW") for car in cars: print(car)
@GaryChike
@GaryChike Ай бұрын
Slightly easier way to loop in reverse: `for x in range(10,1,-1):` = `for x in reversed(range1,11)):`
@isabellagenova3442
@isabellagenova3442 5 ай бұрын
hey
@anishpataskar1253
@anishpataskar1253 6 ай бұрын
duuuuudeee how do i run 2 lines of code in the same for loop lets say i wannna add a number to x 10 times and print it hapy 10 times in the same for loop
@tylerstove3946
@tylerstove3946 3 ай бұрын
It's the same way that he printed happy new year.
@bahodirsiddiqov3071
@bahodirsiddiqov3071 10 ай бұрын
number 13 is an orphan😂😂😂😂
@naomiiki4569
@naomiiki4569 3 ай бұрын
Para mim, é o contrário, haha. Tenho pouca paciência ao aprender coisas e acabo interrompendo o curso frequentemente para me envolver em projetos.
@lifetolive5149
@lifetolive5149 9 ай бұрын
Bro code is always bro friendly -_-
@hethere4345
@hethere4345 2 ай бұрын
Hmmmm we need matlab in my Engineering college.
@vaibhavmalhotra4855
@vaibhavmalhotra4855 Ай бұрын
Is "continue" really used for skipping?
@redalemzawak6683
@redalemzawak6683 8 күн бұрын
Yeh
@lovethischannel2054
@lovethischannel2054 Жыл бұрын
i know only fruitloops
@edikblank3759
@edikblank3759 Жыл бұрын
fruity boy
@md.mahbubanamtanim9081
@md.mahbubanamtanim9081 7 ай бұрын
Bro Code -"Let's stick with x.." Me- Oh heeellll nawwwwww
@SerapioSergiovich
@SerapioSergiovich 23 күн бұрын
Nice video shows methods to create a business..
@luisladino6162
@luisladino6162 12 күн бұрын
Thanks bro
@rekhasharma-gy9bc
@rekhasharma-gy9bc 4 ай бұрын
Thanks bro
While loops in Python are easy ♾️
6:58
Bro Code
Рет қаралды 307 М.
Nested loops in Python are easy ➿
5:35
Bro Code
Рет қаралды 257 М.
Они убрались очень быстро!
00:40
Аришнев
Рет қаралды 1,6 МЛН
Как быстро замутить ЭлектроСамокат
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 12 МЛН
100❤️ #shorts #construction #mizumayuuki
00:18
MY💝No War🤝
Рет қаралды 20 МЛН
5 Useful Dunder Methods In Python
16:10
Indently
Рет қаралды 50 М.
Type casting in Python is easy 💱
7:37
Bro Code
Рет қаралды 92 М.
Python *ARGS & **KWARGS are awesome! 📦
14:54
Bro Code
Рет қаралды 69 М.
for Loop with range() Function in Python
11:55
Neso Academy
Рет қаралды 37 М.
The Fastest Way to Loop in Python - An Unfortunate Truth
8:06
mCoding
Рет қаралды 1,4 МЛН
Python dictionaries are easy 📙
8:06
Bro Code
Рет қаралды 192 М.
Python For Loops - Python Tutorial for Absolute Beginners
14:42
Programming with Mosh
Рет қаралды 553 М.
Они убрались очень быстро!
00:40
Аришнев
Рет қаралды 1,6 МЛН