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

相关内容

热门资讯

什么加咖啡 说起咖啡,不管你爱不爱喝,它都成了极受年轻人追捧的事物。在你家楼下,在窄巷的拐角处,甚至在乡村,咖啡...
原创 王... 王鸥在最近参与的综艺节目中,因为频繁在搜证环节掏出零食与同伴分享而引发了观众热烈讨论。有人注意到,她...
刘集黄酒,正在改写南阳黄酒产业... 刘集黄酒,正在改写南阳黄酒产业新格局 长期以来,南阳黄酒坐拥千年酿造文脉、成熟产区根基,却长期深陷发...
原创 国... 标题:国宴白菜清汤寡水?实则经历了无数道工序,每一道都很严谨 在探讨国宴上的白菜清汤时,我们可能会...
禾利生湿面批发的湿面,其营养成... 在当今的湿面市场中,禾利生湿面批发的湿面凭借其独特的优势和特点,吸引了众多消费者的关注。接下来,我们...