mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-29 20:26:07 -04:00
Another commit
This commit is contained in:
parent
ac7a68da17
commit
a071c64242
@ -1,4 +1,31 @@
|
||||
#!/usr/bin/python3
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
# mari von steinkirch @2013
|
||||
# steinkirch at gmail
|
||||
|
||||
|
||||
def reverse_str(s):
|
||||
''' in place '''
|
||||
sr_ls = []
|
||||
for i in range(len(s)-1, -1, -1):
|
||||
sr_ls.append(s[i])
|
||||
return ''.join(sr_ls)
|
||||
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
s1 = 'abcdefg'
|
||||
s2 = 'buffy'
|
||||
s3 = ''
|
||||
print(reverse_str(s1))
|
||||
print(reverse_str(s2))
|
||||
print(reverse_str(s3))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
>>>>>>> parent of 7b79f58... Faster, better, stronger
|
||||
|
||||
# Mari von Steinkirch @ 2013
|
||||
# mari.wahl9@gmail.com
|
||||
|
Loading…
x
Reference in New Issue
Block a user