Answer to Question #299972 in Python for sruthi

Question #299972

0 0 1 0 0

0 1 1 1 0

1 1 1 1 1


can i get code for this please!


1
Expert's answer
2022-02-19T12:01:59-0500
num = 3
c = 1
for i in reversed(range(0,num)):
    mesg = '0'*i+'1'*c+'0'*i
    print(' '.join(list(mesg)))
    c += 2

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS