Login and get codingIn this Bite you make a generator of rhombus shapes. You will complete
gen_rhombus
that when called like this:gen = gen_rhombus(5) # gen_rhombus is a generator for row in gen: print(row)
... will generate the following output:* *** ***** *** *When called with a greater width (you only have to worry about uneven widths for this exercise):
gen = gen_rhombus(11) for row in gen: print(row)
... the output would be:* *** ***** ******* ********* *********** ********* ******* ***** *** *So the middle row is always equal to the
width
passed in. Checkout howformat
orf-strings
can help you here, as well as therange
builtin. Have fun!
Will you be the 124th person to crack this Bite?
Resolution time: ~47 min. (avg. submissions of 5-240 min.)
Our community rates this Bite 1.86 on a 1-10 difficulty scale.
» You can do it! 😌