how to check if string is camelcase python

Solutions on MaxInterview for how to check if string is camelcase python by the best coders in the world

showing results for - "how to check if string is camelcase python"
Madeleine
06 May 2016
1def is_camel_case(s):
2    return s != s.lower() and s != s.upper() and "_" not in s
3
4
5tests = [
6    "camel",https://stackoverflow.com/questions/10182664/check-for-camel-cas...
7    "camelCase",
8    "CamelCase",
9    "CAMELCASE",
10    "camelcase",
11    "Camelcase",
12    "Case",
13    "camel_case",
14]
15
16for test in tests:
17    print(test, is_camel_case(test))
18