How to do that by while loop | Sololearn: Learn to code for FREE!


How to do that by while loop

1,2,3,4,5,3,2,1 1,2,3,4,3,2,1 1,2,3,2,1 1,2,1 1

9/4/2021 10:18:26 AM

Nafi Rahat Rahman

3 Answers

New Answer


Nafi Rahat Rahman Here the code goes using for loop I believe , you can convert it into while loop Good Luck πŸ‘ a=5 for i in range(a) : for j in range(1,a+1-i): print(j,end=",") for k in range(a-1-i,0,-1) : print(k,end=",") print() I hope it helped ☺️


Looks like homework buddy. Can you provide your attempt so we may guide you. Providing a complete answer will not help you learn


β™€β™’β˜ž πŠπ’π’π›π¨ π†π‘πšπ²πšπ₯ β˜œβ™’β™€ , there should not be comma at each end of the line !?