Generation

generate functionSat, 03 Dec 2022

Hari is a civil engineer who is designing a fountain in square shape with water sprinklers in the edges with n number of steps. He needs to draw a sketch of the fountain in top view with the step number at the edges of the square. Write a program to help him in printing the pattern with n number of steps Input format Input is an positive integer describing the step levels of the fountain Output format Output consists of the pattern of numbers as described in the question form number of step levels. Sample testcases Input 1 77°F Partly sunny Output 1

def printPattern(): for i in range(1,int(input())): #More than 2 lines will result in 0 score. Do not leave a blank line also print(((10**i-1)//9)*i)

Questions about programming?Chat with your personal AI assistant