title: Simple Java Pyramid using nested for loops
body: <p>I am having a great deal of trouble trying to figure out a way to create a pyramid using a user's input. Here is what it is suppose to look like.</p>
  
  <pre><code>Enter a number between 1 and 9: 4
  O
  O
  O
  O
  OOOO
  OOOO 
  OOOO 
  OOOO
  O
  OO
  OOO
  OOOO
  </code></pre>
  
  <p>This is what I have so far</p>
  
  <pre><code>public static void main(String[] args) {
      int number;
      Scanner keyboard = new Scanner(System.in); 
  
      System.out.print("Enter a number between 1 and 9: ");
      number = keyboard.nextInt();
  
      for (int i = 1; i &lt; 10; i++){
          for (int rows = number; number &lt; i; rows++){
              System.out.print("O");
          }
          System.out.println();  
      }
  }
  </code></pre>
  
  <p>I completely understand of what I am trying to accomplish, but I do not completely understand how for loops work. Any help would be greatly appreciated as I am completely lost!</p>