Reputation: 16349
Jupyter Notebook refuses to print underscores in strings.
task_line = '### [TASK] Building the app for wonders \n'
task_pattern = "# [TASK]"
task_name = task_line.split(task_pattern)[-1].strip()
task_name.replace(" ", "_")
Prints: 'Building_the_app_for_wonders'
However, a stripped down example does the replace correctly:
task_name = 'Building the app for wonders'
task_name.replace(" ", "_")
Prints: 'Building_the_app_for_wonders'
What is the cause of this?
Upvotes: 1
Views: 955
Reputation: 16349
The problem is not with Jupyter notebook but with the way the underscore is rendered in the example. The browser decided not to show the underscore for that particular resolution. :)
Zooming in show that it's just a presentation problem.
Upvotes: 3