Nested Loop In Python -15 | Python Nested Loops Tutorial | Python For Beginners | Simplilearn

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ม.ค. 2025

ความคิดเห็น • 14

  • @SimplilearnOfficial
    @SimplilearnOfficial  3 ปีที่แล้ว +1

    Got a Question on this topic? Let us know in the comment section below 👇 and we'll have our experts answer it for you.

  • @joshwzr1257
    @joshwzr1257 2 ปีที่แล้ว +2

    Thanks a lot sir. I previously tried to understand nested loops but was yet giving up on them until I landed on your explanation. You deserve a sub, as I have done so.

  • @michaelmaklan3962
    @michaelmaklan3962 2 ปีที่แล้ว +10

    I dont understand what does print (end=" ") do. And I dont understand why do we need to print an empty brackets at some of the examples? Would you please explain. Thank you

  • @nimaanmi
    @nimaanmi 6 หลายเดือนก่อน +1

    I always had this issue as to why we did x in soandso and y in x within a nested for loop.. I hope the college books had fruits and then y in fruits as example,, this makes it more simple to understand. ❤

  • @lilyarman
    @lilyarman 3 ปีที่แล้ว +1

    Very clear and brilliant presentation. Thanks

  • @megalas683
    @megalas683 ปีที่แล้ว +1

    Sir using while loops for both outer and inner the inner loop condition is i >j which means 11 >11 how the condition works in that part ?

    • @SimplilearnOfficial
      @SimplilearnOfficial  ปีที่แล้ว +3

      "In a nested while loop, you have an outer loop and an inner loop. The inner loop is executed repeatedly for each iteration of the outer loop.
      Let's say the outer loop has a counter variable i that starts at 11 and is decremented by 1 each time the loop runs. The inner loop has a counter variable j that also starts at 11 and is decremented by 1 each time the inner loop runs.
      The condition i > j in the inner loop means that the loop will continue to run as long as i is greater than j. In the first iteration of the outer loop, i is equal to 11, so the inner loop will run as long as j is less than or equal to 11. In the first iteration of the inner loop, j is also equal to 11, so the loop will run at least once.
      As the outer loop continues to iterate, i is decremented, and the inner loop will run for fewer iterations each time. When i is equal to 10, the inner loop will run as long as j is less than or equal to 10. When i is equal to 9, the inner loop will run as long as j is less than or equal to 9, and so on.
      In general, the condition i > j in a nested while loop means that the inner loop will run as long as the counter variable of the outer loop is greater than the counter variable of the inner loop. This allows you to perform some action for each combination of values of the two counter variables."

  • @shrutimohan7812
    @shrutimohan7812 3 ปีที่แล้ว +1

    Very informative!

    • @SimplilearnOfficial
      @SimplilearnOfficial  3 ปีที่แล้ว

      Thanks for watching our video and sharing your thoughts. Do subscribe to our channel and stay tuned for more. Cheers!

  • @aparnaappu6961
    @aparnaappu6961 ปีที่แล้ว +1

    How we get jupyter notebook in phone sir

  • @bijlimahadev4826
    @bijlimahadev4826 3 ปีที่แล้ว

    good content