Jul-30-2019, 01:43 PM
import sys rows=colcnt=11 dotcnt=center=(rows-1) for cnt in range(1,(rows+1)): print("".ljust(dotcnt,'.'),end='') for c in range(dotcnt,colcnt): print ((cnt%10),end='') cnt=cnt+1 if(c < center) else cnt-1 print () dotcnt-=1 colcnt+=1
Output:..........1
.........232
........34543
.......4567654
......567898765
.....67890109876
....7890123210987
...890123454321098
..90123456765432109
.0123456789876543210
123456789010987654321
Please help me to make this code more than what i wrote, thanks For example , below code , i want to make print() comes inside the for loop , which i am not able to , please help
for c in range(dotcnt,colcnt): print ((cnt%10),end='') cnt=cnt+1 if(c < center) else cnt-1 print ()