# 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)
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
I don’t know if this is considered programming but after a very long while of learning python and c++ i recently decided to start developing a roblox game in Lua (which im doing at this very moment while typing this reply)
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
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.
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
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!
question:at 4:22 you have written ''else:'' wich i tried not to write it and see what happens.Nothing changed,so why did you write it (i am asking because of curiosity)
hi! can you please tell how to use for i in range (a, b) and write all decimals between a and b please. I don't understand cause a and b can be only integer, how can i write all decimals (that is a float) between a and b? Thank you !
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
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 :(
thanks for distracting me from ninjago overture theme that has been stuck in my head for hours. i am a c++ programmer but i want to learn python so i know complicated languages.
""" Here I have added while loop in the nested for loops So if the user type a letter or a number, it will ask you to type a symbol instead Yes I have changed the variable from rows and columns to length and breadth respectively to relate this code more to Math """ #Print a rectangle using symbols print("Rectangle using symbols") length = int(input("Enter number of symbols you want horizontally: ")) breadth = int(input("Enter the number of symbols you want vertically: ")) symbol = str(input("Enter the symbol: ")) for x in range(breadth): for y in range(length): while symbol.isalpha() or symbol.isdigit(): # While condition if the user type any letter or number then the loop will run symbol = str(input("Enter the symbol not a letter from alphabet or a number: ")) print(symbol, end="") print()
@@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.
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
Why in the world they decided to use "continue" instead of "skip". I hope skip does something that makes more sense, otherwise this is utterly meaningless.
I guess because in practical use or exception handling, you use it when you get an exception. After detecting the exception, the program handles it and *_continues_* without crashing. It's the same keyword in other languages.
# 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)
hi
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
bro code -- range star pattern !!!!
Yes..scratch would be helpful!🙏😿
Thanks from india bro
i just need to say thank you, i have a programming exam tomorrow and your videos are saving my life
You got me into programming
are you still in programming?
@@droneit7961 i still am but i stopped for months because i have a final exam and i’ll finally graduate ;))
Im also wondering, still grinding?
I don’t know if this is considered programming but after a very long while of learning python and c++ i recently decided to start developing a roblox game in Lua (which im doing at this very moment while typing this reply)
@@Qtaro-oh you learning loops logic and developed a game?
You explain everything in such an easy to understand way
Thank you! Im taking python course by myself but 100 day python instructor didnt explain well. This makes me understand superbly well!
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
Best explanation and easy to understand. Thank you!!
Finally! Someone who gets straight to the point!
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!
Thank u so much for this video. I was having trouble for understanding this function with my professor's videos. You explained it so well.
This stuff was confusing in my course and in my book. This really helped clear up some confusion. Thanks man!
bro's a gigachad, physically and mentally
I was first confused at coding but ur explanation is marvelous i like how you teach programming
Thanks! Short and helpful!
You are an excellent instructor!
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.
This way to explain it's really nice
nicely explained! thanks!
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
Keep up the good work! You helped me out and now i understand more and better! Thank you
Thank you, that was such a straight forward explanation.
i might actually pass my practical tmrw tysm for this vid
thank you so much for helping. i understand you so well.
bro you helped me with my coding project with this tutorial! Thankyou
Nice and useful, tnx❤
Thank You!
great video
Really big thanks for your videos. Subbed! Trying to learn python and its not easy when our techer is not the best ;)
Really helpful!
i your videos just clear all my doughts . arigato gozaimasu !!
This episode is really interesting, keep it up!
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
great
Love from India ❤
thank you i had watched alot of videos and couldnt understand, yet i understand now good day.
thank you
Just started coding, see you in a few years!
High quality content. You win me as a subscriber.
Good vids bro🤞🏽
Thanks
have a sub bro, appreciate your free education and very easy to learn video!
Bro you are the best guy for programming
bro, you're my hero
nice course❤
NICELY DONE...❤
Good "for" you
you are awesome
🤩
what a nice video
That was helpful
Thanks 🙏🙏
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!
very useful
Once again great tutorial Bro Code
Thanks bro
question:at 4:22 you have written ''else:'' wich i tried not to write it and see what happens.Nothing changed,so why did you write it (i am asking because of curiosity)
You are awesome
Thank you :)
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
hi! can you please tell how to use for i in range (a, b) and write all decimals between a and b please. I don't understand cause a and b can be only integer, how can i write all decimals (that is a float) between a and b? Thank you !
tutorials are so goated
love u bro u make me to understand ❤❤❤❤
1:47 thanks today is my birthday 🥳
great examples
i'm pretty sure the for loop executes faster than the while loop too.
What extension pack are you using to get you VS code layout to look like that?
your the best =))
Thank u so much bro
Congratulation for 1M subscribers🥳
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? 😮
thx
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
Slightly easier way to loop in reverse: `for x in range(10,1,-1):` = `for x in reversed(range1,11)):`
Okay, so a "for" loop is sort of a countdown or timer?
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 :(
Can you tell me how you have two screens
Thank you Benson Adventure Time!
you rock Bro!
hey whats an itiration i need some simple definiton
can you please make data structure algorithm course for C++? Please!!!!
👏
what IDE are you using?
its pycharm
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
print ("Thank you")
thanks for distracting me from ninjago overture theme that has been stuck in my head for hours. i am a c++ programmer but i want to learn python so i know complicated languages.
"""
Here I have added while loop in the nested for loops
So if the user type a letter or a number, it will ask you to type a symbol instead
Yes I have changed the variable from rows and columns to length and breadth respectively to relate this code more to Math
"""
#Print a rectangle using symbols
print("Rectangle using symbols")
length = int(input("Enter number of symbols you want horizontally: "))
breadth = int(input("Enter the number of symbols you want vertically: "))
symbol = str(input("Enter the symbol: "))
for x in range(breadth):
for y in range(length):
while symbol.isalpha() or symbol.isdigit():
# While condition if the user type any letter or number then the loop will run
symbol = str(input("Enter the symbol not a letter from alphabet or a number: "))
print(symbol, end="")
print()
Heyy , Can you upload Full stack MERN web development course ?? Please 🥺
So if we want to use for loop on a list, do we turn the list into strings with .str() after the list
To turn a list into a string you use:
newString = "".join(your_list)
yes just go like this cars = ("Mercedes", "Audi", "BMW")
for car in cars:
print(car)
Coming from Java, Python is heck confusing for me.
I understand other C based languages such as C# and C++ better 😅
Tbf,
Java, C# and C++
are like the children of C
so Python will feel alot different 🤔
Can't jump into OOP right away
#while loops = Used to execute loops infinite amount of times.
#for loops = used to execute loops a fixed number of times.
Para mim, é o contrário, haha. Tenho pouca paciência ao aprender coisas e acabo interrompendo o curso frequentemente para me envolver em projetos.
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?
maybe you can use a [for item in 'name of the directory']
@@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.
i didn´t understand this thank you
Is "continue" really used for skipping?
Yeh
why do I feel guilty for not paying and getting this for free. No cap 10x btr than most payed python courses
hey
Ya think?!?
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
It's the same way that he printed happy new year.
I fkin love you
Why in the world they decided to use "continue" instead of "skip". I hope skip does something that makes more sense, otherwise this is utterly meaningless.
I guess because in practical use or exception handling, you use it when you get an exception.
After detecting the exception, the program handles it and *_continues_* without crashing.
It's the same keyword in other languages.
number 13 is an orphan😂😂😂😂
Hmmmm we need matlab in my Engineering college.
Proud to be 5th commenter
Bro code is always bro friendly -_-