We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Introduction
- Print Function
- Discussions
Print Function
Print Function
Sort by
recency
|
3516 Discussions
|
Please Login in order to post a comment
n = int(input()) for i in range(n): print(i+1,end="")
Efficient and Simple Code
12345...N ---should be string as mentioned in question
n = int(input())
result = ''
for i in range(1, n + 1):
result += f"{i}"
print(result)
if name == 'main': n = int(input())
if name == 'main': n = int(input()) a = 1 op = [] while n!=0: op.append(str(a)) a=a+1 n=n-1 final="".join(op) print(final)
n = int(input()) print(*[num for num in range(1, n+1)], sep='')