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
|
3501 Discussions
|
Please Login in order to post a comment
if name == 'main': n = int(input()) for i in range(1, n+1): print(i, end='')
Simply add this in print statement ,end="")
CODE :
for i in range (1,n+1): print(i,end="")
if name == 'main': n = int(input()) num = [] for i in range(int(n)): num.append(i + 1)
print("".join(str(item) for item in num))
Seems a little complicated but this is how my brain wanted to do it haha
if name == 'main': n = int(input())
for i in range(1,n+1): print(i , end="")
if name == 'main': n = int(input()) output = 1 j = 1 for i in range(2,n+1): if i%(10**j)==0: j = j+1 multiplier = 10**j output = output*multiplier+i