-
Code reverse = lambda x: x[::-1] if isinstance(x, str) else int(str(x)[::-1])
Test Cases test.assert_equals(reverse('aaaaaaabc'), 'cbaaaaaaa') test.assert_equals(reverse('320947873434169728465327'), '723564827961434378749023') test.assert_equals(reverse('fghrefudjfhigufdhjkbehiwgyd87v9sfiehufgydufehwgfdyvsegrt78eyt8fguyrv78fgd4irv78fhyrv...fg. . , .dfs,defehfegruekfhdgu'), 'ugdhfkeurgefhefed,sfd. , . .gf...vryhf87vri4dgf87vryugf8tye87trgesvydfgwhefudygfuheifs9v78dygwihebkjhdfugihfjduferhgf') test.assert_equals(reverse(''), '') test.assert_equals(reverse(12355), 55321) test.assert_equals(reverse(23465782465328241973852672384973586273243582698734362097432849367832374386957374806395762387362975342748369274534783629743), 34792638743547296384724357926378326759360847375968347323876394823479026343789628534237268537948327625837914282356428756432)
Output:
-
Code reverse = lambda x: x[::-1] if type(x) is str else int(str(x)[::-1])- reverse = lambda x: x[::-1] if isinstance(x, str) else int(str(x)[::-1])
- All
- {{group.name}} ({{group.count}})
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}