HackerRank Python Problem No4 || Strings

preview_player
Показать описание
Without using any string methods, try to print the following:
123...n

Note that ... represents the consecutive values in between.

Example
n=5
Print the string 12345

Input Format
The first line contains an integer .

Output Format
Print the list of integers from through as a string, without spaces.
Рекомендации по теме
Комментарии
Автор

Thanks for your video. I did it slightly different.

n = int(input())
my_string = ""
for i in range(n):
my_string+=str(i+1)
print(my_string)

DevWithEv
Автор

😂😂 this is how I got... I know this is not a perfect code because not using the actual concept of string

for i in range(1, n+1):
print(i, end="")

webricated
Автор

the question was without string right?

sankarshana_g