This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#check if the word is in camel case | |
#ip: "helloWorld" | |
#op: True | |
def isCamelCase(word): | |
#check for whitespaces | |
res = bool(re.search(r"\s", word)) | |
if (not res): | |
x = re.search(r"^[a-z](.+?)([A-Z])",word) | |
if (x): | |
return True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("hello world!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_camelCaseSplit(self): | |
self.assertEqual(camelCaseSplit("theDarkKnightRises"),["the","Dark","Knight","Rises"]) | |
self.assertEqual(camelCaseSplit("helloW"),["hello","W"]) | |
self.assertEqual(camelCaseSplit("helloIWorld"),["hello","I","World"]) | |
with self.assertRaises(TypeError): | |
camelCaseSplit(1234) |
NewerOlder