Python Forum
Printing out a triangle using nested for loops
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Printing out a triangle using nested for loops
#11
I don't think what you have counts. I think the idea they are looking for is to have an outer for loop that goes through the rows of the diagram, and then have an inner for loop that prints the asterisks one at a time.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#12
What's the difference? I have 2 for loops nested inside a while loop ... that should work right ? Or must it be a for loop nested inside another for loop for it to fit the definition of "nested" ?
Reply
#13
(Jan-16-2019, 07:01 PM)MrGoat Wrote: Or must it be a for loop nested inside another for loop for it to fit the definition of "nested" ?

My understanding of the phrase "nested for loops" would be a for loop inside a for loop, yes.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  reduce nested for-loops Phaze90 11 1,762 Mar-16-2023, 06:28 PM
Last Post: ndc85430
Sad triangle numbers Woody_MC_2022 5 1,144 Sep-24-2022, 08:14 PM
Last Post: deanhystad
  Nested for loops: Iterating over columns of a DataFrame to plot on subplots dm222 0 1,641 Aug-19-2022, 11:07 AM
Last Post: dm222
  Nested for loops - help with iterating a variable outside of the main loop dm222 4 1,532 Aug-17-2022, 10:17 PM
Last Post: deanhystad
  breaking out of nested loops Skaperen 3 1,175 Jul-18-2022, 12:59 AM
Last Post: Skaperen
  Break out of nested loops muzikman 11 3,243 Sep-18-2021, 12:59 PM
Last Post: muzikman
  How to break out of nested loops pace 11 5,264 Mar-03-2021, 06:25 PM
Last Post: pace
  Nested for Loops sammay 1 7,322 Jan-09-2021, 06:48 PM
Last Post: deanhystad
  How to make this function general to create binary numbers? (many nested for loops) dospina 4 4,332 Jun-24-2020, 04:05 AM
Last Post: deanhystad
  Python beginner - nested while loops mikebarden 1 1,838 Jun-01-2020, 01:04 PM
Last Post: DPaul

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020