学习笔记(6):零基础掌握 Python 入门到实战-深入浅出字符串(二)

it2025-01-30  14

立即学习:https://edu.csdn.net/course/play/26676/338775?utm_source=blogtoedu

索引:对序列中元素进行编号 编号叫做索引(从左0开始)右为-1

str[0] 代表去第一个字符

str[0:5] 去第一个到第4个数字

str[0:5:1]步长1

步长如果为负数那边代表把字符串反序

a=input(‘a的值为:’)

>>>a的值为:3

>>>a

>>>3

相关资源:微信小程序源码-合集6.rar
最新回复(0)