Python: Convert snake case string to camel case string
Python Regular Expression: Exercise-37 with Solution
Write a python program to convert snake case string to camel case string.
Sample Solution:-
Python Code:
def snake_to_camel(word):
import re
return ''.join(x.capitalize() or '_' for x in word.split('_'))
print(snake_to_camel('python_exercises'))
Sample Output:
PythonExercises
Pictorial Presentation:
Flowchart:

Visualize Python code execution:
The following tool visualize what the computer is doing step-by-step as it executes the said program:
Python Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a python program to convert camel case string to snake case string.
Next: Write a Python program to extract values between quotation marks of a string.
What is the difficulty level of this exercise?
Inviting useful, relevant, well-written and unique guest posts
- New Content published on w3resource :
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- React - JavaScript Library
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework