-3
I would like my code to result instead of a list a single string Ex: n = 5 the code returns me [1, 2, 3, 4, 5] I would like it to return me '12345' transforming all elements into a single string. what can I do?
n = int(input())
previous = []
i = 1
while(i <= n):
previous.append(i)
i = i + 1
if(len(previous) == n):
print(previous)
Replace all your code with that line
print("".join(map(str,range(1,int(input())+1))))
– Augusto Vasques