improve scripts

This commit is contained in:
Rohit Tanwar
2018-02-22 09:35:43 +05:30
parent 8b4f245d2a
commit 0ca01ec1bf
5 changed files with 4 additions and 14 deletions

View File

@ -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]

View File

@ -22,5 +22,4 @@ is_upper_case:string
is_lower_case:string is_lower_case:string
count_by:list count_by:list
difference_by:list difference_by:list
insertion_sort:list insertion_sort:list

View File

@ -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)

View File

@ -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]

View File

@ -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&#39;Hello {val}&#39;)
wow!
</code></pre>
</html>