How to achieve the below output in python with the help of range and loops functionality available in python?
Expected output:
0000
1111
2222
3333
The below way works, but if the number needs to be printed till 100 then, 100 print statements needs to be written, the below way is a time consuming process.
Rather than writing in the below way of writing the code and achieving the output in the above way. Is there any short way to write the code and achieve the desired output?
for i in range(4):
print(i,end='')
print(i,end='')
print(i,end='')
print(i)