Hi all, I want to print the output as below:-
I tried to solve the problem above as below:-
Output:1
X2
XX3
XXX4
XXXX5
XXX4
XX3
X2
1I tried to solve the problem above as below:-
line = '12345'
for i in range(1,6):
print(line[-i:])
for i in range(1,6):
print(line[i:])output:Output:5
45
345
2345
12345
2345
345
45
5how it works in crop what I want? can anyone help?
