Youβve been recruited by the OASIS Guild of Gemsmiths. Your task? Forge a perfect digital diamond from asterisks (*). The diamond must be symmetrical, centered, and formed entirely using loops β no string multiplication allowed until the bonus!
Your program will prompt the user to enter a number β the height of the diamondβs top half (not counting the middle line twice). For example, if the user enters 3, your output should look like:
β The user enters an integer height between 2 and 10.
β The program must validate the input and prompt again if out of range.
β The top half of the diamond (including the middle) should be built using a loop.
β The bottom half (mirrored) should also use a loop.
β The output must be centered β spacing matters!
β Do not use str.center() or '*' * n β build the lines manually using loops.
β Use only loops and string concatenation to build each line of output.
π Loopless Trickery: Try using string multiplication like '*' * i to build a version.
Must use statements like: '*' * i or 'Β ' * n
π Diamond Outline: Don't fill the diamond in!!
π Color the Diamond: Use ANSI escape codes to print the top in one color, and the bottom in another.
You'll see examples of the basic program output here.
You can see one filled in, and the other one just the outline
I've also included one with a menu so you can see which options I've included!