Last active
March 17, 2017 19:45
-
-
Save Omig12/e4ff3f9d0f940fbef082914e2add020b to your computer and use it in GitHub Desktop.
Revisions
-
Omig12 revised this gist
Mar 17, 2017 . No changes.There are no files selected for viewing
-
Omig12 revised this gist
Mar 17, 2017 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,8 @@ #!/usr/bin/env python3 # l = Full list or string to be reversed. # start = Index where the sub-string to be reversed starts # end = Index where the sub-string to be reversed ends def rev_sub(l, start, end): return l[0:start]+l[start:end+1][::-1]+l[end+1:] -
Omig12 revised this gist
Mar 17, 2017 . No changes.There are no files selected for viewing
-
Omig12 created this gist
Mar 16, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ def rev_sub(l, start, end): return l[0:start]+l[start:end+1][::-1]+l[end+1:]