improve scripts
This commit is contained in:
@ -233,7 +233,7 @@ difference_by([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], lambda v : v['x']) # [ { x
|
|||||||
|
|
||||||
On a very basic level, an insertion sort algorithm contains the logic of shifting around and inserting elements in order to sort an unordered list of any size. The way that it goes about inserting elements, however, is what makes insertion sort so very interesting!
|
On a very basic level, an insertion sort algorithm contains the logic of shifting around and inserting elements in order to sort an unordered list of any size. The way that it goes about inserting elements, however, is what makes insertion sort so very interesting!
|
||||||
```py
|
```py
|
||||||
def insertionsort(arr):
|
def insertion_sort(arr):
|
||||||
|
|
||||||
for i in range(1, len(arr)):
|
for i in range(1, len(arr)):
|
||||||
key = arr[i]
|
key = arr[i]
|
||||||
|
|||||||
@ -23,4 +23,3 @@ is_lower_case:string
|
|||||||
count_by:list
|
count_by:list
|
||||||
difference_by:list
|
difference_by:list
|
||||||
insertion_sort:list
|
insertion_sort:list
|
||||||
|
|
||||||
|
|||||||
@ -3,4 +3,5 @@ from pytape import test
|
|||||||
from average import average
|
from average import average
|
||||||
def average_test(t):
|
def average_test(t):
|
||||||
t.true(isinstance(average, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'average is a function')
|
t.true(isinstance(average, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'average is a function')
|
||||||
|
t.equal(2,2,'equal')
|
||||||
test('Testing average',average_test)
|
test('Testing average',average_test)
|
||||||
@ -1,4 +1,4 @@
|
|||||||
def insertionsort(arr):
|
def insertion_sort(arr):
|
||||||
|
|
||||||
for i in range(1, len(arr)):
|
for i in range(1, len(arr)):
|
||||||
key = arr[i]
|
key = arr[i]
|
||||||
|
|||||||
@ -1,10 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link href="prism.css" rel = "stylesheet"></link>
|
|
||||||
</head>
|
|
||||||
<script src="prism.js"></script>
|
|
||||||
<pre><code class="language-python">def Hello_World(val):
|
|
||||||
print(f'Hello {val}')
|
|
||||||
wow!
|
|
||||||
</code></pre>
|
|
||||||
</html>
|
|
||||||
Reference in New Issue
Block a user