1 Upvote

Print a List of Integers From 1 Through N as a String Without Spaces

Python
General Python

Prints a list of integers from 1 through n inclusive as a string without spaces.

n = 5
print(*range(1,n+1),sep="")

By detro - Last Updated Feb. 24, 2022, 6:28 p.m.

Did you find this snippet useful?

Sign up to bookmark this in your snippet library

COMMENTS
RELATED SNIPPETS
Python For Else Loop
Python
General Python

Loop

2
Top Contributors
103
100