From f20a9e3b13912b5e1ec80f31936466ea7cdc5b24 Mon Sep 17 00:00:00 2001 From: Tony Date: Tue, 11 Sep 2018 10:01:20 -0700 Subject: [PATCH 1/2] updated comment --- test.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test.py b/test.py index 7c0ef3c..336c17a 100644 --- a/test.py +++ b/test.py @@ -22,10 +22,7 @@ def fizz_buzz(self, digit_1, digit_2): print i def json_to_csv(self, json_file_path, outfile_path): - """Convert a file containing a list of flat JSON objects to a csv. - - What's a DictWriter, you say? Never heard of it! - + """DictWriter has saved my life!!! """ with open(json_file_path) as f: data = json.load(f) From c4765d92c64afcc0faa1e098205a4e4e4f270f14 Mon Sep 17 00:00:00 2001 From: Tony Date: Tue, 11 Sep 2018 10:01:47 -0700 Subject: [PATCH 2/2] added bubble_sort --- test.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test.py b/test.py index 336c17a..d04f160 100644 --- a/test.py +++ b/test.py @@ -21,6 +21,15 @@ def fizz_buzz(self, digit_1, digit_2): else: print i + def bubble_sort(self, alist): + length = len(alist) - 1 + for i in range(0, length): + if alist[i] > alist[i + 1]: + # alist[i], alist[i+1] = alist[i+1], alist[i] # python way + temp = alist[i] + alist[i] = alist[i + 1] + alist[i + 1] = temp + def json_to_csv(self, json_file_path, outfile_path): """DictWriter has saved my life!!! """