It outputs special characters as many as the number of rows, and parameter 1 uses superposition for statement to output special characters parameter 2 How should I make a function code to enter the number of lines?
num=int(input())
num2=int(input())
a = input()
for i in range(num):
for j in range(num2):
if j <= i:
print(a,end='')
print()
I made it like this
python function
num = int(input())
a = input()
def steps(a, num):
for i in range(num):
for j in range(num):
if j <= i:
print(a, end="")
print()
steps(a, num)
© 2024 OneMinuteCode. All rights reserved.