Python Program For Number Pattern Rules