How to use Unicode in Python

Unicode is a universal code to interpret any language it may be Hindi, English or greek or Malayalam. So we decided to write   a simple program to demonstrate the use of Unicode in Python
Unicode in Python

Here is our simple Python Program using Unicode and Microsoft indic input put tools software to type the Hindi language on Visual studio Code.

# हमारा हिंदी में लिखा पाइथन प्रोग्राम 
# प्रोग्राम में आप कीवर्ड को अपनी भाषा में नहीं लिख सकते है 

अ = 0
for क in range(1,20):
    अ += क
print("पहले दस नम्बरों का सम है :",अ)

The output of the above python program in unicode is as follows

rakesh@folio MINGW64 /e/python (master)
$ python -u "e:\python\"
पहले दस नम्बरों का सम है : 190

The point must be remembered while writing your code in Unicode is – You can not write keywords/functions and methods in Unicode they must appear in the English language only.

Hope this will help you to explore your local language in Python.

Print Friendly, PDF & Email

Related Posts

If you like CBSEToaday and would like to contribute, you can also write an article using submit article or mail your article to See your article appearing on the main page and help other students/teachers.