当前位置:网站首页>String output
String output
2022-06-29 02:18:00 【Long street 395】
describe
The user enters a string , Output characters with even forward index sequence number in one line . Such as user input :“hello”, After the program runs, output “hlo”.
Input format
Enter a string
Output format
Output a string
Example 1
Input :hello
Output :hloThe first is to use C Language thinking :
n=input()
t=len(n)
p=''
for i in range(0,t):
if(i%2==0):
p=p+n[i]
print(p)
The second kind python The minimalist :
str = input()
print(str[::2])
#print(a[0:len(a):2]) It's fine too , Omit the start and end positions in the previous line of code , the last one 2 It's the step length 边栏推荐
- Wechat campaign auto like
- 2022.02.15
- [understanding of opportunity -33]: seeing is not necessarily true. Most of the time, "seeing is false"
- 利用kubernetes資源鎖完成自己的HA應用
- 字符串输出
- 如何成为一名高级数字 IC 设计工程师(6-5)数字 IC 验证篇:覆盖率收集
- How to become a senior digital IC Design Engineer (4-5) script: file comparison operation implemented by shell script
- Live broadcast preview | can SQL also play industrial machine learning? Mlops meetup V3 takes you to the bottom!
- [redis] list type
- Blog publishing test 2
猜你喜欢

How to become a senior digital IC Design Engineer (4-2) script: file read / write operation realized by Verilog HDL code

Koa 快速入门

How to become a senior digital IC Design Engineer (4-3)

How to become a senior digital IC Design Engineer (4-5) script: file comparison operation implemented by shell script

CTFHub-Web-密码口令-弱口令

Day10 enumeration class and annotation

Finally got the byte offer. The 25-year-old inexperienced experience in software testing is written to you who are still confused

2022.02.15

【Redis】Hash类型
Scala Foundation (3): Operators and Process Control
随机推荐
目标检测——ADAS实战
Blog publishing test 1
110. simple chat room 13: chat room server
How to become a senior digital IC Design Engineer (6-7) digital IC Verification: debug skills
Smart world 2030
Google Borg paper
Talk about the copyonwritearraylist of JUC
[redis] hash type
Blog publishing test 2
Google Borg论文
【学习笔记】子集和问题
数字 IC 设计、FPGA 设计秋招笔试题目、答案、解析(1)2022 紫光展锐(上)
如何成为一名高级数字 IC 设计工程师(6-6)数字 IC 验证篇:系统级仿真
跨境资讯站
HashSet storing objects and how to not store the same objects
I have summarized some experiences from the whole process of R & D platform splitting
温度转换 II
【Redis】SortedSet类型
芯片原厂必学技术(1)引言
MySQL details - aggregation and grouping