Question: Assignment 2 B: Diamonds in the sky . In our earliest labs, we asked you to print a diamond pattern to the screen using predefined
Assignment B: Diamonds in the sky
In our earliest labs, we asked you to print a diamond pattern to the screen using predefined print statements. Now that we know how to use loops, we can make more dynamic and customizable patterns.
For this assignment, we will prompt the user to enter a single character and a maximum width for the diamond. If they enter a number less than we'll prompt them to choose a correct width. If they enter an even number greater than we will add to it and let the user know the final diamond size. Then we will generate and print out the diamond using the user's inputted character and symbols.
Hints: Each line of the "diamond" is made up of two parts the character in the center and the spaces to the left of it The amount of "left space" decreases as we go towards the middle diamond, then increases afterwards as we go towards the bottom. Could we use multiple loops or even nested loops to model this behavior? Also, note that the number of characters increases and later decreases by two on each line.
Call the file name
AssignmentBpy
User input is indicated in bold
Sample output #: Please do in python
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
