2017-04-07 130 views
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'

是什麼原因呢?

回答

1

問題不在於Jupyter筆記本,而是在示例中呈現下劃線的方式。瀏覽器決定不顯示該特定分辨率的下劃線。 :)

enter image description here

中顯示,這只是一個演示問題放大。

enter image description here