How to make a text bold within print statement in ipython notebook

machine_learning
ipython
python
jupyter_notebook

#1

Hi,

I want to print a string in bold font in ipython notebook but not able to achieve it. I tried using few solutions provided on stackoverflow but didn’t succeed.

Attached is the code that I was working on. The yellow highlighted part in screenshot is the one I want in bold font. I’m trying to change the font into bold using value in start variable and then bringing it back to normal using value in end variable.

Hope Python aficionado will surely help me here.

Thanks
Kailash Negi


#2

@kailash_negi, as mentioned here, you can do something like this

from IPython.display import Markdown, display
def printmd(string):
    display(Markdown(string))
printmd('**bold**')

#3

@jalFaizy, Thanks a lot friend.

I have implemented it now and it worked…

Thanks a ton :slight_smile:

Regards,
Kailash Negi