And below Python concepts are used to print that patterns

  • For Loop
  • While Loop
  • if..else

1). Program to print Solid Rectangle using star(*) in Python

solid rectangle pattern program in C

Output

2). Program to print hollow Rectangle using star(*) in Python

hollow rectangle program in c

Output

hollow rectangle program in c