当前位置:网站首页>Usage of string slicing
Usage of string slicing
2022-07-25 10:15:00 【Wendianfei】
st[start:end:step] Start , end , step
#!/usr/bin/python
#-*- coding:utf-8 -*-
str = "abcdef"
## Print a character
print str[0]
## Print label 0,1 The characters of , barring 2
print str[0:2]
## Print from page 0 Start , To the first 3 All strings ending in , Excluding the 3 individual
print str[:3]
## Two characters apart , Print from page 0 Start , To the first 3 All strings ending in , Excluding the 3 individual , The last one is step size
print str[:3:2]
## Reverse printing
print str[::-1]
边栏推荐
猜你喜欢

UE4 窗口控制(最大化 最小化)

Rest使用与原理

Probability theory and mathematical statistics 4 continuous random variables and probability distributions (Part 1)

rospy Odometry天坑小计
![[necessary for growth] Why do I recommend you to write a blog? May you be what you want to be in years to come.](/img/f5/e6739083f0dce8da1d09d078321633.png)
[necessary for growth] Why do I recommend you to write a blog? May you be what you want to be in years to come.

Use of dictionary tree

CentOs安装redis

Subtotal of rospy odometry sinkhole

拷贝过来老的项目变成web项目

ROS分布式操作--launch文件启动多个机器上的节点
随机推荐
数据库MySQL详解
Dataset 和 Dataloader数据加载
Introduction to arm GIC
nodejs链接mysql报错:ER_NOT_SUPPORTED_AUTH_MODEError: ER_NOT_SUPPORTED_AUTH_MODE
史上最全面的UE4 文件操作,打开,读、写,增、删、改、查
Filter filter details (listeners and their applications)
CCF 201604-2 Tetris
一文学会,三款黑客必备的抓包工具教学
SSM integration (simple library management system to integrate SSM)
VLAN的配置及其应用(以华为eNSP为例)
小程序分享功能
IO流中的输入流
Is binary cross entropy really suitable for multi label classification?
IDEA整体字体大小修改
C3D模型pytorch源码逐句详析(一)
cookie and session
RedisUtil
CentOs安装redis
FPGA basic advanced
nodejs版本升级或切换的常用方式