Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python 3 Diamond Code Question How can I get the my output to look exactly like this? Preferably using def. Here is the code that

Python 3 Diamond Code Question
How can I get the my output to look exactly like this?
Preferably using def.
image text in transcribed
Here is the code that I tried:
Notice the spacing on diamond(2), there are only 2 (**) asterisks in the middle, and on the one I am trying to achieve there are 3(***). I just need help formatting the spacing. Thanks!
image text in transcribed
17 18 diamond (1 diamond (2 diamond (5 ( 19 20 1 Process finished with exit code 0 In [14]: def diamond (rows) : for i in range(rows) : print(" "* (rows-i-1)+ " *"* (i+1)) for j in range (rows-1,0,-1): print(" "*(rows-7)+" *"*(j)) diamond (1) diamond (2) diamond (5) * * * * * *

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

=+Are they specific or general in nature?

Answered: 1 week ago

Question

=+ What is the nature of the contracts or agreements with unions?

Answered: 1 week ago

Question

=+What is the procedure for labor relations in the workplace?

Answered: 1 week ago