HackerRank,一行代码解决输出问题

Task 
Read an integer N.

Without using any string methods, try to print the following:

1,2,3.....N

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

Input Format 
The first line contains an integer N.

Output Format 
Output the answer as explained in the task.

Sample Input

3

Sample Output

123

Pro Tip 
You can use the print function inside a map(). Can you do a 1 line code to solve the problem above?

from __future__ import print_function
map(lambda x: print(x,end=''), range(1,input()+1))


你可能感兴趣的:(HackerRank,一行代码解决输出问题)