0
Jupyter Notebook拒絕在字符串中打印下劃線。Jupyter筆記本不打印下劃線?
task_line = '### [TASK] Building the app for wonders \n'
task_pattern = "# [TASK]"
task_name = task_line.split(task_pattern)[-1].strip()
task_name.replace(" ", "_")
打印:'Building_the_app_for_wonders'
然而,剝離下來的例子並正確更換:
task_name = 'Building the app for wonders'
task_name.replace(" ", "_")
打印:'Building_the_app_for_wonders'
是什麼原因呢?