题解 | #截取字符串#
截取字符串
http://www.nowcoder.com/practice/a30bbc1a0aca4c27b86dd88868de4a4a
while True:
try:
a = input()
k = int(input())
print(a[0:k]) #截取前k个字符并输出
except:
break
截取字符串
http://www.nowcoder.com/practice/a30bbc1a0aca4c27b86dd88868de4a4a
while True:
try:
a = input()
k = int(input())
print(a[0:k]) #截取前k个字符并输出
except:
break
相关推荐