Pattern numbers and stars-1 python contest

https://ide.geeksforgeeks.org/ucqUS1LiT7
https://hack.codingblocks.com/app/contests/2293/1266/problem
why it is not passing all testcases?