I want to print a string with the same character repeated once right after it. For example, if the input is "hello", the program would output "hheelllloo". The code
for i in "hello":
print(i, end=i)
works, but I suppose I just do not understand it. I would expect this to give the same output as:
for i in "hello":
print(i + i)
Could anyone explain how the top code works?
end=iwithend="_"so you can visualize what it is doing.