Cognizant Interview Question

WAP to print pattern in python