Construct the following pattern.

In this program, we will construct the following star pattern.

   *
   * *
   * * *
   * * * *
   * * * * *
   * * * *
   * * *
   * *
   *

Steps to solve the program
  1. Use for loop with range function to print the first 5 rows of the pattern.
  2. Use for loop with range function but in reverse order to print the last 4 rows of the pattern.
  3. Use -1 in the range function to print the pattern in reverse order.

Output :

numbers which are divisible by 7 and multiple of 5

add the word from the user to the empty string

Leave a Comment