# nested loop = A loop within another loop (outer, inner) # outer loop: # inner loop: rows = int(input("Enter the # of rows: ")) columns = int(input("Enter the # of columns: ")) symbol = input("Enter a symbol to use: ") for x in range(rows): for y in range(columns): print(symbol, end="") print()
I don't know why but my brain really, REALLY wants to overthink both for loops and nested loops. They're really simple concepts but something always gets wonky in the monkey wires. This was a great video, really needed something to explain it in the most babymode 5 year old way, thank you
THAT IS SO WELL THOUGHT OUT! BRILLIANT! AND I AM STARTING TO UNDERTAND HOW PROGRAMMERS THINK AND DEVELOP THEIR PROGRAMS! THANK YOU SO MUCH FOR ALL YOUR TUTORIALS!
Thank you much This is the first time I have understood nested loops, pattern after watching so many videos God bless Please keep making more videos on programming
First semester CS student. Nested loops confused the hell out of me in class last week. This video helped clear some of the confusion. Much appreciated!
@@NorfaizahMatLui take your time, what worked for me was writing it on a whiteboard, and trying to explain it with my own words, if you think about it it's like multiplication: For n in range(3) For z in range(5) Print("hello") The first for loop will tell you how many times the next loop will be done, in this case 3, and then the second loop, will print 5 "hello": Hello hello hello hello hello Hello hello hello hello hello Hello hello hello hello hello You printed 5 hello's, 3 times
Thx bro for the good explanation I have an exam tomorrow and I didn’t understand nested loops bcz the explanation in the digital book that the school gave me was CONFUSING AND COMPLICATED
Man I could barely understand a word my programmer teacher said during the entire semester. He had this really thick south-asian accent. Took me several lessons to understand that he was saying "unicode" and not "unicorn", let alone understanding what unicode is. The language was Java which is a bit unintuitive compared to Python and the course book was this 600 pages, dull, black and white textbook that I couldn't muster any motivation to read multiple pages out of. Somehow I managed to get the highest grade in Programming 101 and the second highest in Programming 102 (I think the teacher was overly nice and just gave out good grades). The end result was that I didn't feel like I understood anything about programming whatsoever despite what my grade sheet said. For some reason I've had a really negative or hopeless attitude towards programming ever since. What I'm trying to say is: these videos are great.
sir how can I use this expression in python for nested loops? val= int(input()) inputs are 2 and 5. and output should be * mark as rectangle shape. Please explain. Thank you.
Here is the code. Replace the placeholders with your file name and path import os def delete_test_file(file_path): try: if os.path.exists(file_path): os.remove(file_path) print(f"File {file_path} deleted.") else: print(f"File {file_path} does not exist.") except Exception as e: print(f"Error: {e}") # Test path to a non-essential file delete_test_file("C:/path/to/non/critical/test/file.txt")
Yes this is easy but there are programs that go like the output should be like the following * * * * * * * * * * * * * or like * * * * * * * * can you make a video on how to do them please
I didn't like the appearance of having a period after the last number in the iteration, so I wanted to change how it looks. But I also wanted to avoid hard-coding it to be the exact number '9'. Here is the solution I came up with, using the str.join() method: for x in range(3): sequence = range(1, 10) last_number = list(sequence)[-1] numbers = [str(y) if y != last_number else str(y) for y in sequence] print(".".join(numbers))
I have watched multiple videos, trying to understand nested loops and this video finally made sense to me! Thanks for breaking this down in such an easy way.
My thing and im in my 3rd werk for python is when I'm reading or watching this material i understand it, but i have an issue seeifn where you use it. Maybe this comes along once you understand all the fundamentals concretely bc i sure as hell don't yet. But this leads to massive overthinking on my part. Like, i have a simple site written in simple html/css. I have made a database in docker with MSSQL, and i want to make a python application to get the data from the DB and display it on the webpage. In very generic terms this is the "stack" im looking for no?
#shapemakerproject ➿ rows = int(input("Enter the number of rows :")) columns = int(input("Enter the number of columns :")) symbol = input("Enter a symbol to use :") for x in range(rows) : for y in range (columns): print(symbol, end="") print()
haha, valeu amigo. Estou fazendo um curso qui no Brasil usam essa refêrencia para ensinar for in range. Vou ver mais aulas, não compreendo inglês, mas entendo o código.
I love you dawg not in a gay way but this vid saved my ass I was having trouble with for loops cause it was a bit confusing to me, then I saw this vid and I understand now. Thanks you got a new subscriber
can you please explain this question Ask the users favorite color and if it is a rainbow color print the color two times and if the color is not a rainbow color print all the even numbers before the birthdate of the user
# nested loop = A loop within another loop (outer, inner)
# outer loop:
# inner loop:
rows = int(input("Enter the # of rows: "))
columns = int(input("Enter the # of columns: "))
symbol = input("Enter a symbol to use: ")
for x in range(rows):
for y in range(columns):
print(symbol, end="")
print()
You're my hero... Love from South Africa :)
There’s a little typo in the code, columns go horizontal so the outer loop in this case represents the columns and inner loop is the rows
I don't know why but my brain really, REALLY wants to overthink both for loops and nested loops. They're really simple concepts but something always gets wonky in the monkey wires. This was a great video, really needed something to explain it in the most babymode 5 year old way, thank you
Same happens to me
Its a completely opposite for me tho i need more in depth explanation
I thought I was the only one
Yeah me too😢
Same condition for everyone else. No one just realises it
Bro, you saved me ass, I was gonna fail for sure but you absolute ultimate gigachad saved my. Thank you King. You dropped this 👑
Chaa
THAT IS SO WELL THOUGHT OUT! BRILLIANT! AND I AM STARTING TO UNDERTAND HOW PROGRAMMERS THINK AND DEVELOP THEIR PROGRAMS! THANK YOU SO MUCH FOR ALL YOUR TUTORIALS!
U are the best🥲, u are supposed to be a lecture😏
Thank you much
This is the first time I have understood nested loops, pattern after watching so many videos
God bless
Please keep making more videos on programming
This is very clever and give me a better understanding in nested loop
This guy is one of my favorite people on Earth. I don't even know who you are but you are 100% a king
Aaah!!! It's all clicked in my head now. Thanks man!
clear explanation, helped and saved my brain from overthinking
First semester CS student. Nested loops confused the hell out of me in class last week. This video helped clear some of the confusion. Much appreciated!
Also a first semester CS student, was totally lost. Hoping this video helps. Will watch when I get home from my lecture.
I have my a levels computer science exam tomorrow and you just saved my life
Perfectly explained, thank you!
took me about an hour but finally I understand nested loops, thank you Bro Code
3 days now, still dont fully understand it
@@NorfaizahMatLui take your time, what worked for me was writing it on a whiteboard, and trying to explain it with my own words, if you think about it it's like multiplication:
For n in range(3)
For z in range(5)
Print("hello")
The first for loop will tell you how many times the next loop will be done, in this case 3, and then the second loop, will print 5 "hello":
Hello hello hello hello hello
Hello hello hello hello hello
Hello hello hello hello hello
You printed 5 hello's, 3 times
@@krosarian that´s actually a pretty good. thx man
@@krosarian Buddy to print what you wrote:
for i in range(3):
for k in range(5):
print("hello", end="")
print()
Hope yer fine.
you are a blessing to me dude !
best explanation of nested loops out there
Thanks for the explanation really needed it I was literally going mad trying to understand it on my own not know that it is not that deep
Thanks for the wonderful video...
Now I understand nexted loop better👏✔️
You entirely clear my concept ... thanks alot bro 😭😭🤌
Thank you sir for your help..
I clearly understand now but I tried it several times, it gives me syntax error I do not know what is wrong
idk why i was so confused on nested loops to start out with now
Thanks bro, you explain them really well
This is a life saver video I have my exam tomorrow so thank u so much
Thank you bro for all your videos. I Iearnt java and javascript extensively through your videos.
You’re awesome man! Thanks
Thank so very much for your help on leaning Python .. Great, to the point Teacher.
Bro, may I say you have such a soothing and beautiful voice? 🤗
great video bro .love from INDIA🧡🤍💚
thanks for your explanation it's really helpful ☺
Thank you so much sir
Thx bro for the good explanation I have an exam tomorrow and I didn’t understand nested loops bcz the explanation in the digital book that the school gave me was CONFUSING AND COMPLICATED
Super content and editing
excellent vid. really well explained. thanks
Man I could barely understand a word my programmer teacher said during the entire semester. He had this really thick south-asian accent. Took me several lessons to understand that he was saying "unicode" and not "unicorn", let alone understanding what unicode is. The language was Java which is a bit unintuitive compared to Python and the course book was this 600 pages, dull, black and white textbook that I couldn't muster any motivation to read multiple pages out of.
Somehow I managed to get the highest grade in Programming 101 and the second highest in Programming 102 (I think the teacher was overly nice and just gave out good grades). The end result was that I didn't feel like I understood anything about programming whatsoever despite what my grade sheet said. For some reason I've had a really negative or hopeless attitude towards programming ever since. What I'm trying to say is: these videos are great.
Dude i fking love u, ur content is outstanding
ahhh this is soo baffling, my brain cannot comprehend this idea
Very clearly explained bro! Thanks!
Wow !! super expalination !@
I finally see the light!😀
Very nice
Brilliant. Thank you.
You are the best!!!!!
very helpful thanks
Thank you so much for this
Bro youre amazing thank you
Hey bro I'm new to python, I just want to kick start my career I'm 23 now, is it ok to learn python from basics., Bcz I feel aged for programming..
It’s never too late
Did you got it bro?
you are awesome
Bro saved me from failing in my class 11th practical exams 🙏🏽🙏🏽🙃
Thx 4 vid bro !
this guy tptally sounds like ryan george from pitch meeting , also thanks for your video made a complex topic so simple
bro you are my G
do you have a matrix done ? That would be great !
sir how can I use this expression in python for nested loops? val= int(input()) inputs are 2 and 5. and output should be * mark as rectangle shape. Please explain. Thank you.
Good job 👍
So I'm doing exactly this but for some reason it's shorting me a symbol at the end.
Can u make it in one line please?
you're awesome
awesome content as always, thanks Bro!👌
Can you make a tutorial how to delete system32 with python ?
no lol
@@BroCodez Ok =l
Here is the code. Replace the placeholders with your file name and path import os
def delete_test_file(file_path):
try:
if os.path.exists(file_path):
os.remove(file_path)
print(f"File {file_path} deleted.")
else:
print(f"File {file_path} does not exist.")
except Exception as e:
print(f"Error: {e}")
# Test path to a non-essential file
delete_test_file("C:/path/to/non/critical/test/file.txt")
@@ElwinJoby Hey thank you !🥰🥰
@@ElwinJoby What have you done
Yes this is easy but there are programs that go like the output should be like the following
*
* * *
* * * * *
* * *
*
or like
*
* *
* *
* *
*
can you make a video on how to do them please
you are the best
Really loved the explanations, thanks! One question, how would the code look like if I wanted to make a triangle tho?
thnx , with anki flashcards would be cool to memorize
respect Teacher.
@Bro Code
I didn't like the appearance of having a period after the last number in the iteration, so I wanted to change how it looks. But I also wanted to avoid hard-coding it to be the exact number '9'. Here is the solution I came up with, using the str.join() method:
for x in range(3):
sequence = range(1, 10)
last_number = list(sequence)[-1]
numbers = [str(y) if y != last_number else str(y) for y in sequence]
print(".".join(numbers))
man i love you thx
THANK YOU SO MUCH
I have watched multiple videos, trying to understand nested loops and this video finally made sense to me! Thanks for breaking this down in such an easy way.
"SAVED, I'M SAVED"
Such a beautiful explanation Sir. Thanks a lot for sharing making it easy to understand for beginners.
My thing and im in my 3rd werk for python is when I'm reading or watching this material i understand it, but i have an issue seeifn where you use it. Maybe this comes along once you understand all the fundamentals concretely bc i sure as hell don't yet. But this leads to massive overthinking on my part.
Like, i have a simple site written in simple html/css. I have made a database in docker with MSSQL, and i want to make a python application to get the data from the DB and display it on the webpage. In very generic terms this is the "stack" im looking for no?
Hey Bro code, do you have an example of a text based game in python??
Thank you
Thank you❤
after first loop can we write print(symbol * columns ) and finish the code ?
Thankyou❤
v v good. ty ❤
Tq so much
end="/t"
Will make your result like a table
I think you mean \t
can someone tell me how to get this type of window in python with the program result at the bottom
Wher full rust tutorial
#shapemakerproject ➿
rows = int(input("Enter the number of rows :"))
columns = int(input("Enter the number of columns :"))
symbol = input("Enter a symbol to use :")
for x in range(rows) :
for y in range (columns):
print(symbol, end="")
print()
a loop inside of an another loop outer loop inner loop
haha, valeu amigo.
Estou fazendo um curso qui no Brasil usam essa refêrencia para ensinar for in range.
Vou ver mais aulas, não compreendo inglês, mas entendo o código.
Thank You make it simple bro codez
Very well explained, thank you!
I love you dawg not in a gay way but this vid saved my ass I was having trouble with for loops cause it was a bit confusing to me, then I saw this vid and I understand now. Thanks you got a new subscriber
Bro can you make a Kotlin tutorial?
I crash course your Java andddddd employers seeks Kotlin....
Bro pls tell which site u use
X is a counter. What is a counter?
Watch the video on for loops
damn ur awesome
❤❤😊😊
This is so easy
this just doesnt click with me at all, this is the hardest concept so far. im hitting a wall and its only week 3. fml
The outside loop indicates how many times we do the inside loop.
Same I understand it on paper but once I try to do anything I get confused
Chad 🗿 explanation
i think you mistaken row for column and column for row
Which app do u use to program?
PyCharm
tini paduko
can you please explain this question
Ask the users favorite color and if it is a rainbow color print the color two times and if the color is not a rainbow color print all the even numbers before the birthdate of the user