diff --git a/week11/akinola/triple_double.md b/week11/akinola/triple_double.md new file mode 100644 index 0000000..b9c1931 --- /dev/null +++ b/week11/akinola/triple_double.md @@ -0,0 +1,2 @@ +Triple Double +Have the function TripleDouble(num1,num2) take both parameters being passed, and return 1 if there is a straight triple of a number at any place in num1 and also a straight double of the same number in num2. For example: if num1 equals 451999277 and num2 equals 41177722899, then return 1 because in the first parameter you have the straight triple 999 and you have a straight double, 99, of the same number in the second parameter. If this isn't the case, return 0. \ No newline at end of file diff --git a/week11/akinola/triple_double.py b/week11/akinola/triple_double.py new file mode 100644 index 0000000..52ce568 --- /dev/null +++ b/week11/akinola/triple_double.py @@ -0,0 +1,10 @@ +def TripleDouble(num1,num2): + str1 = str(num1) + str2 = str(num2) + for t in str1: + if t*3 in str1 and t*2 in str2: + return 1 + return 0 + +# keep this function call here +print TripleDouble(raw_input()) \ No newline at end of file