mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-05-22 16:31:15 -04:00
Add some cool queue, stacks, strings, math, bit manipulation examples (#35)
This commit is contained in:
parent
f3ee2cdf52
commit
0f455a0322
24 changed files with 932 additions and 13 deletions
15
arrays_and_strings/playing_with_strings.py
Normal file
15
arrays_and_strings/playing_with_strings.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
# author: bt3gl
|
||||
|
||||
def reverse_array_in_place(array):
|
||||
""" Reverse an array in place """
|
||||
return array[::-1]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
print('Testing reverse_array_in_place')
|
||||
array = [1, 2, 3, 4, 5]
|
||||
print(f'Array: {array}')
|
||||
print(f'Reversed: {reverse_array_in_place(array)}')
|
Loading…
Add table
Add a link
Reference in a new issue