Posted on ::

子字符串输出

描述

按要求完善示例程序:‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬

#分两行输出 python语言程序设计 #python字符串可采用区间形式访问,采用[M:N]格式表示字符串中从M到N-1的子字符串

name = ‘python语言程序设计’ print(name[ ]) #在[]中填上合适的数字,使此语句输出python print(name[ ]) #在[]中填上合适的数字,使此语句输出语言程序设计

输入格式

没有输入

输出格式

python 语言程序设计

代码

name = 'python语言程序设计'
print(name[:6]) # 对字符串进行切片
print(name[6:])
Table of Contents