HackerRank,一行代码解决输出问题
2015-12-03 00:00
525 查看
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
Sample Output
Pro Tip
You can use the print function inside a map(). Can you do a 1 line code to solve the problem above?
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))
相关文章推荐
- Java 日期时间 Date类型,long类型,String类型表现形式的转换
- spring自带定时任务概要
- 蜂窝教育Java培训 让我跨过就业障碍
- config.txt for raspberry pi b 2
- springMVC 拦截器如何做登录检查及页面跳转
- Mybatis整合Spring
- python加入自定义库/模块路径
- python扩展包安装更新
- ThinkPHP,根据ip定位,切换城市
- JAVA基础之分布式对象
- JAVA高级特性-流与文件
- 使用github
- Java内部类详解
- django实现长链接
- Java NIO:浅析I/O模型
- php5.3升级到5.5
- java.io.IOException: Bad connect ack with firstBad
- TP-基础
- 树链剖分+线段树 hdu3966 Aragorn's Story
- eclipse导入hadoop示例源码on ubuntu14.04