w3resource

Python: Print Unicode characters


Print Unicode Characters

Write a Python program to print Unicode characters.

Sample Solution:

Python Code:

# Create a Unicode string by specifying each character's Unicode escape sequence.
str = u'\u0050\u0079\u0074\u0068\u006f\u006e \u0045\u0078\u0065\u0072\u0063\u0069\u0073\u0065\u0073 \u002d \u0077\u0033\u0072\u0065\u0073\u006f\u0075\u0072\u0063\u0065'

# Print a blank line for separation.
print()

# Print the Unicode string, which will be displayed as "Python Exercises - w3resource".
print(str)

# Print another blank line for separation.
print()

Sample Output:

Python Exercises - w3resource

Flowchart:

Flowchart: Print Unicode characters.

For more Practice: Solve these Related Problems:

  • Write a Python program to print a Unicode character given its code point.
  • Write a Python program to convert a Unicode character to its hexadecimal representation.
  • Write a Python program to find and print all Unicode characters in a given range.
  • Write a Python program to replace non-ASCII characters in a string with their closest ASCII equivalent.

Python Code Editor:

 

Previous: Write a Python program to compute the product of a list of integers (without using for loop).
Next: Write a Python program to prove that two string variables of same value point same memory location.

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.



Follow us on Facebook and Twitter for latest update.