یک جمله داده شده است، تابعی بنویسید که حرف اول هر کلمه را به کلمه بعدی در جمله منتقل کند (انتقال به راست).
نمونه ورودی و خروجی
shift_sentence("create a function") ➞ "freate c aunction"
shift_sentence("it should shift the sentence") ➞ "st ihould shift she tentence"
shift_sentence("backendbaz") ➞ "backendbaz"
نکات:
- حرف اول آخرین کلمه به اولین کلمه در جمله منتقل میشود.
- تمام جملات با حروف کوچک نوشته شدهاند.
- توجه کنید که کلمات تکی بدون تغییر باقی میمانند (مثال شماره 3).
shift_sentence("create a function") ➞ "freate c aunction"
shift_sentence("it should shift the sentence") ➞ "st ihould shift she tentence"
shift_sentence("backendbaz") ➞ "backendbaz"
shift_sentence("the output is not very legible") ➞ "lhe tutput os iot nery vegible"
shift_sentence("tey ghis uot hnscrambled") ➞ "hey this got unscrambled"
shift_sentence("i love to eat scrambled eggs and ham") ➞ "h iove lo tat ecrambled sggs end aam"
shift_sentence("mitochondria is the powerhouse of the cell") ➞ "citochondria ms ihe towerhouse pf ohe tell"
نظرات