语法练习: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

相关内容

热门资讯

国庆黄金周景区情况:大同古城半... 文| 芙昕 编辑 | 芙昕 国庆长假,很多人都计划着出门走走,可一到了那些热门景点,看到的往往不是山...
来大东北一共分两步:先“冷藏”... 还在被“东北=冰窖”的刻板印象吓退? 南方的“小土豆”们 别急着裹紧小棉袄 这个冬天 让“气候缓冲带...
第三届“长城之约”活动在河北涞... 11月15日,第三届"长城之约"全球推广活动暨世界文化遗产对话15日在河北省保定市涞源县启幕。 本次...
巴厘岛:时光在此停驻 (自由行... 曾几何时,世人只知巴厘岛而不知印尼。巴厘岛的美太过耀眼,以至于人们常常忘记——它只是印尼万千岛屿中最...