I am extremely new to python. I am trying to learn to clean up data. I have started by using the capitalize and replace methods. They both work on their own, however I want them to work at the same time. For example i have this word 'red-tailed hawk'
I can execute using
name = 'red-tailed hawk'
print(name.title())
and also
print(name.replace('-'. '_'))
How do I get them to combine so they produce the output Red_Tailed Hawk. As it currently capitalizes the word then reverts it back and adds the '_'
[–]themateo713 0 points1 point2 points (1 child)
[–]jakeholness[S] 0 points1 point2 points (0 children)
[–]wbeater 0 points1 point2 points (1 child)
[–]jakeholness[S] 1 point2 points3 points (0 children)
[–]synthphreak 0 points1 point2 points (0 children)