Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Print the "approval" sign/check mark (✓) U+2713 in Python

Tags:

python

unicode

How can I print the check mark sign "✓" in Python?

It's the sign for approval, not a square root.

like image 783
Mauro Avatar asked May 21 '13 17:05

Mauro


People also ask

How do I make a checkmark in Python?

How can I print the check mark sign "✓" in Python? It's the sign for approval, not a square root. You are looking for unicode character: U+2713.

What is the unicode for a check mark?

U+2713 ✓ CHECK MARK.

How do I text a check mark?

Option two. Open the Microsoft Word, Excel, or PowerPoint application. On the Home tab, in the Font section, click the Font drop-down list and select the Wingdings font. Create a check mark symbol by pressing and holding Alt , and then typing 0252 using the numeric keypad on the right side of the keyboard.


Video Answer


2 Answers

You can print any Unicode character using an escape sequence. Make sure to make a Unicode string.

print u'\u2713' 
like image 142
Jerome Avatar answered Sep 20 '22 02:09

Jerome


Since Python 2.1 you can use \N{name} escape sequence to insert Unicode characters by their names. Using this feature you can get check mark symbol like so:

$ python -c "print(u'\N{check mark}')" ✓ 

Note: For this feature to work you must use unicode string literal. u prefix is used for this reason. In Python 3 the prefix is not mandatory since string literals are unicode by default.

like image 22
Mr. Deathless Avatar answered Sep 19 '22 02:09

Mr. Deathless