aboutsummaryrefslogtreecommitdiff
path: root/challenge-261/zapwai/python/ch-2.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-261/zapwai/python/ch-2.py')
-rw-r--r--challenge-261/zapwai/python/ch-2.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/challenge-261/zapwai/python/ch-2.py b/challenge-261/zapwai/python/ch-2.py
new file mode 100644
index 0000000000..1048ae11cd
--- /dev/null
+++ b/challenge-261/zapwai/python/ch-2.py
@@ -0,0 +1,14 @@
+def double_me(ints,start):
+ flag = True
+ while flag:
+ flag = False
+ for i in ints:
+ if i == start:
+ flag = True
+ start *= 2
+ return start
+
+ints = [5, 3, 6, 1, 12]
+start = 3;
+print("Input:", ints, "start:", start)
+print("Output:", double_me(ints, start))