From 3f084f7c8c730cbe9c69ba7dcc4c446f0c1e812b Mon Sep 17 00:00:00 2001 From: avdeshmishra0214 Date: Sat, 29 Sep 2018 09:23:56 +0000 Subject: [PATCH] Done --- __pycache__/__init__.cpython-36.pyc | Bin 0 -> 170 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 179 -> 185 bytes .../__pycache__/build.cpython-36.pyc | Bin 463 -> 428 bytes q01_chocolates/build.py | 14 ++++++++++---- .../tests/__pycache__/__init__.cpython-36.pyc | Bin 185 -> 191 bytes .../test_q01_chocolates.cpython-36.pyc | Bin 1762 -> 1768 bytes 6 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 __pycache__/__init__.cpython-36.pyc diff --git a/__pycache__/__init__.cpython-36.pyc b/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9aee1d547125d85af93779f6bde417084fe4c287 GIT binary patch literal 170 zcmXr!<>k8QxIUVZfq~&M5W@jTzyXMhS%5?eLokCTqu)w~B9JhG_!X|7k)NBYpIDZX zTAY!aS)5UnXkcV$q92}LlwDkqn4GGgoS%}apH`HZT#}d*pOKiHomy0sn3o-&ky(_P ummZ&-k(iT{nwOp$Z>%35pP83g5+AQuPg=@U}OP8E=C?kK1MDk wKE@&rpqQT~QxsQbUO{OI*g~)v*a{>9WWp^Do80`A(wtN~79g(}7n2wD z+@`9e)bx$xEb7Q=Oajb7hmG+7_ZSuKW9gAQ^I7O6rdZZ}eDC$~TjCPe4o|aOF10%2 K)K%U0&fpg^8cqHH diff --git a/q01_chocolates/build.py b/q01_chocolates/build.py index ed96c95..854ccae 100644 --- a/q01_chocolates/build.py +++ b/q01_chocolates/build.py @@ -1,12 +1,18 @@ +# %load q01_chocolates/build.py input_list = [] # Write your solution here: - - def q01_chocolates(my_list=input_list): - - + new1 = [] + iprev= 0 + for i in my_list: + if i % 2 == 1: + new1.append(i+iprev) + iprev = i+iprev + else: + new1.append(iprev) + return (new1) diff --git a/q01_chocolates/tests/__pycache__/__init__.cpython-36.pyc b/q01_chocolates/tests/__pycache__/__init__.cpython-36.pyc index 701653826940ef168f2717fd45f0e007bf3a5eb7..c15c22bf90d3b44db78543dd27b4157cd7d82e20 100644 GIT binary patch delta 58 zcmdnVxSx^3n3tF9jpO?0i5%u?Ir