Write a Python program that can create four different patterns of different sizes. The size of each pattern is determined by the number of columns or rows. For example, a pattern of size 5 has 5 columns and 5 rows. Each pattern is made up of the character P and a digit , which shows the size. The size must be between 2 and 9. The following shows the four different patterns for size 5. Pattern 1 5PPPP PPPP5 PPPPP PPPPP P5PPP Pattern 2 PPP5P PPPP5 5PPPP PP5PP PP5PP Pattern 3 PPP55 55PPP PPP5P P5PPP PP555 Pattern 4 555PP PPPP5 5PPPP P5555 5555P Your program should display a menu and ask the user to choose a pattern and a size. Your program must be robust; it must prompt the user to an option between 1 and 4 or 15 , and a pattern size must be between 2 and 9. Has to use at least 4 functions in which each function represents one pattern and has to use Switch, for, and while loops
Write a Python program that can create four different patterns of different sizes. The size of each pattern is determined by the number of columns or rows. For example, a pattern of size 5 has 5 columns and 5 rows. Each pattern is made up of the character P and a digit , which shows the size. The size must be between 2 and 9. The following shows the four different patterns for size 5.
Pattern 1 5PPPP PPPP5 PPPPP PPPPP P5PPP
Pattern 2 PPP5P PPPP5 5PPPP PP5PP PP5PP
Pattern 3 PPP55 55PPP PPP5P P5PPP PP555
Pattern 4 555PP PPPP5 5PPPP P5555 5555P
Your program should display a menu and ask the user to choose a pattern and a size. Your program must be robust; it must prompt the user to an option between 1 and 4 or 15 , and a pattern size must be between 2 and 9. Has to use at least 4 functions in which each function represents one pattern and has to use Switch, for, and while loops
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images