语法练习:non_start
admin
2024-03-26 02:38:18

语法练习:non_start

题目:non_start

Given 2 strings, return their concatenation, except omit the first char of each. The strings will be at least length 1.

non_start(‘Hello’, ‘There’) → ‘ellohere’
non_start(‘java’, ‘code’) → ‘avaode’
non_start(‘shotl’, ‘java’) → ‘hotlava’

我的解答:

def non_start(a, b):return a[1:] + b[1:]

Expected Run
non_start(‘Hello’, ‘There’) → ‘ellohere’ ‘ellohere’ OK
non_start(‘java’, ‘code’) → ‘avaode’ ‘avaode’ OK
non_start(‘shotl’, ‘java’) → ‘hotlava’ ‘hotlava’ OK
non_start(‘ab’, ‘xy’) → ‘by’ ‘by’ OK
non_start(‘ab’, ‘x’) → ‘b’ ‘b’ OK
non_start(‘x’, ‘ac’) → ‘c’ ‘c’ OK
non_start(‘a’, ‘x’) → ‘’ ‘’ OK
non_start(‘kit’, ‘kat’) → ‘itat’ ‘itat’ OK
non_start(‘mart’, ‘dart’) → ‘artart’ ‘artart’ OK
other tests
OK

All Correct

相关内容

热门资讯

把音乐厅搬进喀斯特溶洞是什么体...   近日,一场融合多元艺术形式的洞穴音乐会在贵州省修文县举行,五百余名观众在喀斯特溶洞之中,感受了一...
教师专享福利!北京这些景区免票... 新京报讯 据首都教育消息,教师节将至,北京多家景区为老师们准备了专属免票福利!这份优惠合集已整理好,...
黑茶,喝的是一种境界与健康 在专门用来喝黑茶的茶具“飘逸杯”里,黑茶茶汤看起来并不像“黑茶”这个名字那样黑黢黢的一团。 玻璃器皿...
上海旅游节大巡游花车阵容抢先看... 2026上海旅游节大巡游9月12日外滩启幕,21辆全新主题花车携手21支境内外表演方队联袂登场,邀你...
原创 8... 上周门诊来了位 62 岁的张阿姨,得糖尿病快五年了,平时管嘴特别严,糖果、点心、甜饮料一概不碰,连水...