← coderbyte_practice

cleanup

5dc9203293ee4942b26fb13a010fc3810398ef64 · ovidiucs · May 6, 2015 21:42

+230 −142 · 36 files changed

  • .idea/.name +1 −0
  • .idea/coderbyte.iml +8 −0
  • .idea/encodings.xml +4 −0
  • .idea/misc.xml +37 −0
  • .idea/modules.xml +8 −0
  • .idea/vcs.xml +6 −0
  • easy/01-first-reverse.py +3 −3
  • easy/02-first-factorial.py +4 −4
  • easy/03-lognest-word.py +5 −6
  • easy/04-letter-changes.py +7 −6
  • easy/05-simple-adding.py +2 −0
  • easy/06-letter-capitalize.py +5 −5
  • easy/07-simple-symbols.py +5 −4
  • easy/08-check-nums.py +2 −3
  • easy/09-time-convert.py +4 −5
  • easy/10-alphabet-soup.py +4 −4
  • easy/11-ab-check.py +6 −6
  • easy/12-vowel-count.py +8 −8
  • easy/13-word-count.py +6 −5
  • easy/14-ex-oh.py +7 −8
  • easy/15-palindrome.py +8 −8
  • easy/16-arith-geo.py +3 −3
  • easy/17-array-addition-1.py +4 −4
  • easy/18-letter-count-1.py +2 −2
  • easy/19-second-great-low.py +7 −7
  • easy/20-division-stringified.py +8 −8
  • easy/21-counting-minutes-1.py +21 −20
  • easy/22-mean-mode.py +3 −3
  • easy/23-dash-insert.py +2 −2
  • easy/24-swap-case.py +2 −1
  • easy/25-number-addition.py +1 −3
  • easy/26-third-greatest.py +3 −3
  • easy/27-powers-of-two.py +7 −5
  • easy/28-additive-persistance.py +1 −1
  • easy/29-multiplicative-persistance.py +2 −2
  • medium/06-string-scramble.py +24 −3
diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..eb0b6ea
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+coderbyte
\ No newline at end of file
diff --git a/.idea/coderbyte.iml b/.idea/coderbyte.iml
new file mode 100644
index 0000000..4e12c0e
--- /dev/null
+++ b/.idea/coderbyte.iml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="jdk" jdkName="Python 2.7.9 (/usr/bin/python2.7)" jdkType="Python SDK" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..d821048
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+</project>
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..277f4d8
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="DaemonCodeAnalyzer">
+    <disable_hints />
+  </component>
+  <component name="DependencyValidationManager">
+    <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+  </component>
+  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
+    <OptionsSetting value="true" id="Add" />
+    <OptionsSetting value="true" id="Remove" />
+    <OptionsSetting value="true" id="Checkout" />
+    <OptionsSetting value="true" id="Update" />
+    <OptionsSetting value="true" id="Status" />
+    <OptionsSetting value="true" id="Edit" />
+    <ConfirmationsSetting value="0" id="Add" />
+    <ConfirmationsSetting value="0" id="Remove" />
+  </component>
+  <component name="ProjectModuleManager">
+    <modules />
+  </component>
+  <component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7.9 (/usr/bin/python2.7)" project-jdk-type="Python SDK" />
+  <component name="PropertiesComponent">
+    <property name="options.lastSelected" value="preferences.editor" />
+    <property name="options.splitter.main.proportions" value="0.3" />
+    <property name="options.splitter.details.proportions" value="0.2" />
+  </component>
+  <component name="PyConsoleOptionsProvider">
+    <option name="myPythonConsoleState">
+      <console-settings />
+    </option>
+  </component>
+  <component name="RunManager">
+    <list size="0" />
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..1a5080a
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/coderbyte.iml" filepath="$PROJECT_DIR$/.idea/coderbyte.iml" />
+    </modules>
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>
\ No newline at end of file
diff --git a/easy/01-first-reverse.py b/easy/01-first-reverse.py
index 35f7ef3..5f90a1a 100644
--- a/easy/01-first-reverse.py
+++ b/easy/01-first-reverse.py
@@ -1,8 +1,8 @@
-#Have the function FirstReverse(str) take the str parameter being passed and return the string in reversed order. 
+# Have the function FirstReverse(str) take the str parameter being passed and return the string in reversed order.
 
 #Use the Parameter Testing feature in the box below to test your code with different arguments.
 def FirstReverse(str):
-  return str[::-1]
+    return str[::-1]
 
-  print FirstReverse(raw_input())           
+    print FirstReverse(raw_input())
 
diff --git a/easy/02-first-factorial.py b/easy/02-first-factorial.py
index 6335cda..e03fa1b 100644
--- a/easy/02-first-factorial.py
+++ b/easy/02-first-factorial.py
@@ -9,11 +9,11 @@ in the box below to test your code with different arguments.
 
 from math import factorial
 
-def FirstFactorial(num): 
 
-  return factorial(num)
-    
-    
+def FirstFactorial(num):
+    return factorial(num)
+
+
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
 print FirstFactorial(raw_input())           
diff --git a/easy/03-lognest-word.py b/easy/03-lognest-word.py
index d8d2cb1..b354003 100644
--- a/easy/03-lognest-word.py
+++ b/easy/03-lognest-word.py
@@ -1,12 +1,11 @@
-def LongestWord(sen): 
-  si = sen.split()
-  return max(si, key=len)
+def LongestWord(sen):
+    si = sen.split()
+    return max(si, key=len)
+
 
-    
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
-print LongestWord(raw_input())           
-
+print LongestWord(raw_input())
 
 """
 Have the function LongestWord(sen) take the sen parameter being passed and return the 
diff --git a/easy/04-letter-changes.py b/easy/04-letter-changes.py
index ba0ae02..4a8681a 100644
--- a/easy/04-letter-changes.py
+++ b/easy/04-letter-changes.py
@@ -10,14 +10,15 @@ def LetterChanges(str):
                 s = y.upper()
                 ns.append(s)
             else:
-        		ns.append(y)
+                ns.append(y)
         else:
-			ns.append(y)
-            
+            ns.append(y)
+
         xs = ''.join(ns)
-        
-    return xs 
-  
+
+    return xs
+
+
 print LetterChanges(raw_input())
 """
 Have the function LetterChanges(str) take the str parameter being
diff --git a/easy/05-simple-adding.py b/easy/05-simple-adding.py
index 09eee78..9fdc27e 100644
--- a/easy/05-simple-adding.py
+++ b/easy/05-simple-adding.py
@@ -3,6 +3,8 @@ Have the function SimpleAdding(num)
 add up all the numbers from 1 to num.
 For the test cases, the parameter num will be any number from 1 to 1000. 
 """
+
+
 def SimpleAdding(num):
     sumall = sum(range(1, num + 1))
 
diff --git a/easy/06-letter-capitalize.py b/easy/06-letter-capitalize.py
index d74a5aa..dbcba3f 100644
--- a/easy/06-letter-capitalize.py
+++ b/easy/06-letter-capitalize.py
@@ -1,10 +1,10 @@
-def LetterCapitalize(str): 
-	return str.title()
-    
-    
+def LetterCapitalize(str):
+    return str.title()
+
+
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
-print LetterCapitalize(raw_input())           
+print LetterCapitalize(raw_input())
 """
 Have the function LetterCapitalize(str) take the str parameter being passed
 and capitalize the first letter of each word. Words will be separated by only one space. 
diff --git a/easy/07-simple-symbols.py b/easy/07-simple-symbols.py
index 2ab60ff..4d85c8a 100644
--- a/easy/07-simple-symbols.py
+++ b/easy/07-simple-symbols.py
@@ -2,20 +2,21 @@ def SimpleSymbols(str):
     li = list(str)
     idx = 0
 
-    while idx+1 < len(li):
+    while idx + 1 < len(li):
         if li[idx] == '+':
             idx += 1
             if li[idx].isalpha():
-                idx +=1
+                idx += 1
                 if li[idx] == '+':
                     return "true"
                 else:
                     return "false"
         elif li[idx].isalpha():
             return "false"
-        idx+=1
+        idx += 1
 
-print SimpleSymbols(raw_input())           
+
+print SimpleSymbols(raw_input())
 """
 Have the function SimpleSymbols(str) take the str parameter
 being passed and determine if it is an acceptable sequence by either returning
diff --git a/easy/08-check-nums.py b/easy/08-check-nums.py
index 4f42155..66b413f 100644
--- a/easy/08-check-nums.py
+++ b/easy/08-check-nums.py
@@ -1,5 +1,4 @@
-def CheckNums(num1,num2): 
-
+def CheckNums(num1, num2):
     if num2 > num1:
         return 'true'
     elif num1 == num2:
@@ -9,7 +8,7 @@ def CheckNums(num1,num2):
 
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
-print CheckNums(raw_input())           
+print CheckNums(raw_input())
 
 """    
 Have the function CheckNums(num1,num2)
diff --git a/easy/09-time-convert.py b/easy/09-time-convert.py
index 003f5de..98036c2 100644
--- a/easy/09-time-convert.py
+++ b/easy/09-time-convert.py
@@ -1,11 +1,10 @@
-def TimeConvert(num): 
+def TimeConvert(num):
+    return str(num / 60) + ':' + str(num % 60)
+
 
-	return str(num/60) + ':'+str( num % 60)
-    
-    
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
-print TimeConvert(raw_input())           
+print TimeConvert(raw_input())
 """
 Have the function TimeConvert(num) take the num parameter being passed and return the number of hours and minutes
 the parameter converts to (ie. if num = 63 then the output should be 1:3). 
diff --git a/easy/10-alphabet-soup.py b/easy/10-alphabet-soup.py
index 731eff3..27d36ae 100644
--- a/easy/10-alphabet-soup.py
+++ b/easy/10-alphabet-soup.py
@@ -1,11 +1,11 @@
 def AlphabetSoup(str):
-  li = list(str)
-  li.sort()
-  return ''.join(li).strip(" ")
+    li = list(str)
+    li.sort()
+    return ''.join(li).strip(" ")
 
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
-print AlphabetSoup(raw_input())           
+print AlphabetSoup(raw_input())
 """
 Have the function AlphabetSoup(str) take the str string parameter being passed and return the string with the letters in alphabetical order (ie. hello becomes ehllo). Assume numbers and punctuation symbols will not be included in the string. 
 
diff --git a/easy/11-ab-check.py b/easy/11-ab-check.py
index 115db4f..2a9a198 100644
--- a/easy/11-ab-check.py
+++ b/easy/11-ab-check.py
@@ -1,18 +1,18 @@
 def ABCheck(str):
     for i in range(0, len(str) - 4):
-        if (str[i] == 'a'):
-            if (str[i + 4] == 'b'):
+        if str[i] == 'a':
+            if str[i + 4] == 'b':
                 return 'true'
-        if (str[i] == 'b'):
-            if (str[i + 4] == 'a'):
+        if str[i] == 'b':
+            if str[i + 4] == 'a':
                 return 'true'
 
     return 'false'
 
-    
+
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
-print ABCheck(raw_input())           
+print ABCheck(raw_input())
 
 """
 Have the function ABCheck(str) take the str parameter being passed and return the string true if the characters a and b are separated by exactly 3 places anywhere in the string at least once (ie. "lane borrowed" would result in true because there is exactly three characters between a and b). Otherwise return the string false. 
diff --git a/easy/12-vowel-count.py b/easy/12-vowel-count.py
index 7095827..260481a 100644
--- a/easy/12-vowel-count.py
+++ b/easy/12-vowel-count.py
@@ -1,13 +1,13 @@
-def VowelCount(str): 
-  o = 0
-  for i in "aeiou":
-    o += str.count(i)
-    
-  return o
-    
+def VowelCount(str):
+    o = 0
+    for i in "aeiou":
+        o += str.count(i)
+
+    return o
+
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
-print VowelCount(raw_input())          
+print VowelCount(raw_input())
 """
 Have the function VowelCount(str) take the str string parameter being passed and return the number of vowels the string contains (ie. "All cows eat grass" would return 5). Do not count y as a vowel for this challenge. 
 """
diff --git a/easy/13-word-count.py b/easy/13-word-count.py
index 5aff2fc..00e1564 100644
--- a/easy/13-word-count.py
+++ b/easy/13-word-count.py
@@ -1,9 +1,10 @@
 def WordCount(str):
-  o = 1
-  o += str.count(" ")
-  
-  return o
-# keep this function call here  
+    o = 1
+    o += str.count(" ")
+
+    return o
+
+# keep this function call here
 # to see how to enter arguments in Python scroll down
 print WordCount(raw_input())
 """
diff --git a/easy/14-ex-oh.py b/easy/14-ex-oh.py
index 7fecb19..4e1d8c9 100644
--- a/easy/14-ex-oh.py
+++ b/easy/14-ex-oh.py
@@ -1,17 +1,16 @@
-def ExOh(str): 
-
+def ExOh(str):
     o = str.count('o')
     x = str.count('x')
-    
+
     if x == o:
-      return 'true'
+        return 'true'
     else:
-      return 'false'
-                  
-    
+        return 'false'
+
+
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
-print ExOh(raw_input())           
+print ExOh(raw_input())
 """
 Have the function ExOh(str) take the str parameter being passed and return the string true if there is an equal number of x's and o's, otherwise return the string false. Only these two letters will be entered in the string, no punctuation or numbers. For example: if str is "xooxxxxooxo" then the output should return false because there are 6 x's and 5 o's. 
 """
diff --git a/easy/15-palindrome.py b/easy/15-palindrome.py
index 3d6ed58..2019799 100644
--- a/easy/15-palindrome.py
+++ b/easy/15-palindrome.py
@@ -1,14 +1,14 @@
 def Palindrome(str):
-  o = str.replace(" ","")
-  
-  if o == o[::-1]:
-    return 'true'
-  else:
-    return 'false'
-  
+    o = str.replace(" ", "")
+
+    if o == o[::-1]:
+        return 'true'
+    else:
+        return 'false'
+
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
-print Palindrome(raw_input())           
+print Palindrome(raw_input())
 """
 Have the function Palindrome(str) take the str parameter being passed and return the string true if the parameter is a palindrome, (the string is the same forward as it is backward) otherwise return the string false. For example: "racecar" is also "racecar" backwards. Punctuation and numbers will not be part of the string. 
 """
diff --git a/easy/16-arith-geo.py b/easy/16-arith-geo.py
index a126177..72cb75b 100644
--- a/easy/16-arith-geo.py
+++ b/easy/16-arith-geo.py
@@ -1,9 +1,9 @@
 def ArithGeo(arr):
     diff = arr[1] - arr[0]
     div = float(arr[1]) / float(arr[0])
-    for index in range(len(arr)-1):
+    for index in range(len(arr) - 1):
         if not (arr[index + 1] - arr[index] == diff):
-            for index2 in range(len(arr)-1):      
+            for index2 in range(len(arr) - 1):
                 if not float((arr[index2 + 1]) / float(arr[index2]) == div):
                     return -1
             return 'Geometric'
@@ -11,7 +11,7 @@ def ArithGeo(arr):
 
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
-print ArithGeo(raw_input())           
+print ArithGeo(raw_input())
 """
 Have the function ArithGeo(arr) take the array of numbers stored in arr
 and return the string "Arithmetic" if the sequence follows an arithmetic
diff --git a/easy/17-array-addition-1.py b/easy/17-array-addition-1.py
index 025421a..e1d7097 100644
--- a/easy/17-array-addition-1.py
+++ b/easy/17-array-addition-1.py
@@ -1,15 +1,15 @@
-def ArrayAdditionI(arr): 
+def ArrayAdditionI(arr):
     targetValue = max(arr)
     arr.remove(targetValue)
     mall = sum(arr)
     if targetValue <= mall:
-       return 'true'
+        return 'true'
     else:
-       return 'false'
+        return 'false'
 
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
-print ArrayAdditionI(raw_input())           
+print ArrayAdditionI(raw_input())
 """
 Have the function ArrayAdditionI(arr) 
 take the array of numbers stored in arr
diff --git a/easy/18-letter-count-1.py b/easy/18-letter-count-1.py
index 5b5f70f..bd17d91 100644
--- a/easy/18-letter-count-1.py
+++ b/easy/18-letter-count-1.py
@@ -7,14 +7,14 @@ def LetterCountI(str):
         for letter in alp:
             if word.count(letter) > 1:
                 le.append(index)
-    if le == []:
+    if not le:
         return -1
 
     return al[le[0]]
 
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
-print LetterCountI(raw_input())           
+print LetterCountI(raw_input())
 """
 Have the function LetterCountI(str)
 take the str parameter being passed
diff --git a/easy/19-second-great-low.py b/easy/19-second-great-low.py
index 6cab76e..568e7d7 100644
--- a/easy/19-second-great-low.py
+++ b/easy/19-second-great-low.py
@@ -1,10 +1,10 @@
-def SecondGreatLow(arr): 
-  alt = sorted(list(set(arr)))
-  if len(alt) == 1:
-    alt.append(alt[0])
-  return ' '.join([str(alt[x]) for x in 1,-2])
-    
-    
+def SecondGreatLow(arr):
+    alt = sorted(list(set(arr)))
+    if len(alt) == 1:
+        alt.append(alt[0])
+    return ' '.join([str(alt[x]) for x in 1, -2])
+
+
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
 print SecondGreatLow(raw_input())           
diff --git a/easy/20-division-stringified.py b/easy/20-division-stringified.py
index e40e0a3..ce8b407 100644
--- a/easy/20-division-stringified.py
+++ b/easy/20-division-stringified.py
@@ -1,15 +1,15 @@
 from math import ceil
 
-def DivisionStringified(num1,num2): 
 
-  resultFloat = num1/float(num2)
-  resultFloatInt = "{:,}".format(int(resultFloat // 1))
-  if resultFloat <= 999:
-    return int(ceil(resultFloat))
-  else:
-  	return resultFloatInt
+def DivisionStringified(num1, num2):
+    resultFloat = num1 / float(num2)
+    resultFloatInt = "{:,}".format(int(resultFloat // 1))
+    if resultFloat <= 999:
+        return int(ceil(resultFloat))
+    else:
+        return resultFloatInt
 
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
-print DivisionStringified(raw_input())       
+print DivisionStringified(raw_input())
 # not working
diff --git a/easy/21-counting-minutes-1.py b/easy/21-counting-minutes-1.py
index 7dc3b50..cf5aee1 100644
--- a/easy/21-counting-minutes-1.py
+++ b/easy/21-counting-minutes-1.py
@@ -1,6 +1,5 @@
 def CountingMinutesI(str):
-
-    e = str.replace(':',' ').replace('-',' ').replace('pm',' p').replace('am',' a').split()
+    e = str.replace(':', ' ').replace('-', ' ').replace('pm', ' p').replace('am', ' a').split()
     g = [int(s) for s in e if s.isdigit()]
 
     if (e[2] == 'p' and e[5] == 'p') or (e[2] == 'a' and e[5] == 'a'):
@@ -8,41 +7,43 @@ def CountingMinutesI(str):
         if g[0] == g[2]:
             if g[1] == g[3]:
                 return 1440
-            
+
             elif g[1] < g[3]:
-                return abs((g[1])-g[3])
-            
+                return abs((g[1]) - g[3])
+
             elif g[1] > g[3]:
-                return 1380+(60-abs((g[1])-g[3]))
-        
+                return 1380 + (60 - abs((g[1]) - g[3]))
+
         elif g[0] < g[2]:
             if g[2] == 12:
                 if g[3] < g[1]:
-                    return 720+((g[2]-g[0])*60)-(abs(g[1]-g[3]))
-                return 720+((g[2]-g[0])*60)+(abs(g[1]-g[3]))
-            return abs((g[1])-g[3])+60*abs((g[2])-g[0])
+                    return 720 + ((g[2] - g[0]) * 60) - (abs(g[1] - g[3]))
+                return 720 + ((g[2] - g[0]) * 60) + (abs(g[1] - g[3]))
+            return abs((g[1]) - g[3]) + 60 * abs((g[2]) - g[0])
 
         elif g[0] > g[2]:
             if g[0] == 12:
                 if g[1] == g[3] or g[1] < g[3]:
-                    return abs((g[1])-g[3])+60*g[2]            
-            return (g[2]*60)+abs((g[1])-g[3])
+                    return abs((g[1]) - g[3]) + 60 * g[2]
+            return (g[2] * 60) + abs((g[1]) - g[3])
 
     elif e[2] == 'a' and e[5] == 'p' or e[2] == 'p' and e[5] == 'a':
         if g[0] == 12 or g[2] == 12:
             if g[2] == 12:
-                return 720-(g[0]*60)+abs(g[1]-g[3])
-            return 720+(g[2]*60)+abs(g[1]-g[3])
+                return 720 - (g[0] * 60) + abs(g[1] - g[3])
+            return 720 + (g[2] * 60) + abs(g[1] - g[3])
         elif g[0] == g[2]:
             if g[3] == g[1]:
                 return 720
             elif g[3] > g[1]:
-                return 720+abs((g[1])-g[3])
+                return 720 + abs((g[1]) - g[3])
             elif g[3] < g[1]:
-                return 720-abs((g[1])-g[3])
+                return 720 - abs((g[1]) - g[3])
         elif g[0] < g[2]:
-            return 720+abs((g[2] - g[0])*60)+abs(g[1]-g[3])
-        
-        return ((g[1])-g[3])+720
-print CountingMinutesI(raw_input())           
+            return 720 + abs((g[2] - g[0]) * 60) + abs(g[1] - g[3])
+
+        return ((g[1]) - g[3]) + 720
+
+
+print CountingMinutesI(raw_input())
 # needs redoing
diff --git a/easy/22-mean-mode.py b/easy/22-mean-mode.py
index d6ae59a..00df8f0 100644
--- a/easy/22-mean-mode.py
+++ b/easy/22-mean-mode.py
@@ -1,9 +1,9 @@
-def MeanMode(arr): 
-    mn =  sum(arr)/len(arr)
+def MeanMode(arr):
+    mn = sum(arr) / len(arr)
     if arr.count(mn) > 1:
         return 1
     return 0
-    
+
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
 print MeanMode(raw_input())           
diff --git a/easy/23-dash-insert.py b/easy/23-dash-insert.py
index 15a366a..8b9cf50 100644
--- a/easy/23-dash-insert.py
+++ b/easy/23-dash-insert.py
@@ -22,8 +22,8 @@ def DashInsert(str):
             IndexError
 
     return "".join(d)
-    
+
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
-print DashInsert(raw_input())           
+print DashInsert(raw_input())
 # needs redoing
diff --git a/easy/24-swap-case.py b/easy/24-swap-case.py
index eaf931e..7b485d2 100644
--- a/easy/24-swap-case.py
+++ b/easy/24-swap-case.py
@@ -7,7 +7,8 @@ def SwapCase(str):
             d.append(letter[1].upper())
 
     return "".join(d)
-# keep this function call here  
+
+# keep this function call here
 # to see how to enter arguments in Python scroll down
 print SwapCase(raw_input())           
 
diff --git a/easy/25-number-addition.py b/easy/25-number-addition.py
index d3afad3..03e8fdd 100644
--- a/easy/25-number-addition.py
+++ b/easy/25-number-addition.py
@@ -9,7 +9,6 @@ def NumberAddition(str):
     except:
         return 0
 
-
     xs = "".join(xc)
 
     for ele in xs:
@@ -18,10 +17,9 @@ def NumberAddition(str):
         else:
             d.append('+')
 
-
     f = "".join(d)
     return eval(f)
-    
+
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
 print NumberAddition(raw_input())           
diff --git a/easy/26-third-greatest.py b/easy/26-third-greatest.py
index ca0aec3..1c97470 100644
--- a/easy/26-third-greatest.py
+++ b/easy/26-third-greatest.py
@@ -1,11 +1,11 @@
 def ThirdGreatest(strArr):
     # code goes here
     d = []
-    for i,v in enumerate(strArr):
+    for i, v in enumerate(strArr):
         d.append((len(v)))
 
-    return "".join(sorted(strArr,key=str.__len__, reverse=True)[2:3])
-    
+    return "".join(sorted(strArr, key=str.__len__, reverse=True)[2:3])
+
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
 print ThirdGreatest(raw_input())           
diff --git a/easy/27-powers-of-two.py b/easy/27-powers-of-two.py
index 7253b05..cdf772c 100644
--- a/easy/27-powers-of-two.py
+++ b/easy/27-powers-of-two.py
@@ -1,10 +1,12 @@
 from math import sqrt
+
+
 def PowersofTwo(num):
-  if sqrt(num) % 2 == 0:
-    return 'true'
-  return 'false'
-    
+    if sqrt(num) % 2 == 0:
+        return 'true'
+    return 'false'
+
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
-print PowersofTwo(raw_input())           
+print PowersofTwo(raw_input())
 # needs work
diff --git a/easy/28-additive-persistance.py b/easy/28-additive-persistance.py
index 06fdc30..7cae730 100644
--- a/easy/28-additive-persistance.py
+++ b/easy/28-additive-persistance.py
@@ -1,5 +1,4 @@
 def AdditivePersistence(num):
-
     counter = 0
     ss = num
 
@@ -14,6 +13,7 @@ def AdditivePersistence(num):
 
     return counter
 
+
 def mpp(nm):
     nm = map(int, str(nm))
     return sum(nm)
diff --git a/easy/29-multiplicative-persistance.py b/easy/29-multiplicative-persistance.py
index 62f27cc..fc3052d 100644
--- a/easy/29-multiplicative-persistance.py
+++ b/easy/29-multiplicative-persistance.py
@@ -1,5 +1,4 @@
 def MultiplicativePersistence(num):
-
     counter = 0
     ss = num
 
@@ -14,13 +13,14 @@ def MultiplicativePersistence(num):
 
     return counter
 
+
 def mpp(nm):
     nm = map(int, str(nm))
     p = 1
     for n in nm:
         p *= n
     return p
-    
+
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
 print MultiplicativePersistence(raw_input())           
diff --git a/medium/06-string-scramble.py b/medium/06-string-scramble.py
index 507f9e0..4c90a7f 100644
--- a/medium/06-string-scramble.py
+++ b/medium/06-string-scramble.py
@@ -8,9 +8,30 @@ def StringScramble(str1,str2):
     if len(ll ^ set(str2)) and len(ll ^ set(str1)):
         return 'false'
     return 'true'
-    
+
+"""
+Using the Python language,
+have the function StringScramble(str1,str2)
+take both parameters being passed and return
+the string true if a portion of str1 characters
+can be rearranged to match str2,
+otherwise return the string false.
+For example: if str1 is "rkqodlw" and str2 is "world"
+the output should return true.
+Punctuation and symbols will not be entered with the parameters.
+
+"""
 # keep this function call here  
 # to see how to enter arguments in Python scroll down
-print StringScramble(raw_input())     
+print StringScramble("abcgggdfe","abcdef")
+print StringScramble("h3llko","hello")
+print StringScramble("coodrebtqqkye","coderbyte")
+print StringScramble("heloooolwrdlla","helloworld")
+print StringScramble("coamamaaqq","comma")
+print StringScramble("letrrkakaeaaaqq","letter")
+print StringScramble("aqwe","qa")
+print StringScramble("yelowrqwedlk","yellowred")
+print StringScramble("cdore","coder")
 
-# not working
+# Input = "cdore" & str2= "coder"Output = "true"
+# Input = "h3llko" & str2 = "hello"Output = "false"
\ No newline at end of file