What is used to create Unicode string in Python?



What is used to create Unicode string in Python?..

Answer / chaitanya

Unicode is a system to represent characters from all the world's different languages.

Two methods can be used to create unicode string:

unicode() method is unicode(string[, encoding, errors]), its arguments should be 8-bit strings. The first argument is converted to Unicode using the specified encoding, if encoding argument left, the ASCII encoding is used for the conversion.

encode() method is encode([encoding], [errors='strict']), which returns an 8-bit string version of the Unicode string.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What is the difference between pickling vs unpickling?

0 Answers  


What is def __ init __ in python?

0 Answers  


What is the difference between range () and xrange () in python 3?

0 Answers  


Why is __ init __ used in python?

0 Answers  


What is a class and super class?

0 Answers  






How do I define a variable?

0 Answers  


Difference between @staticmethod and @classmethod in python?

0 Answers  


How to give comments in python?

0 Answers  


Which command do you use to exit help window or help command prompt?

0 Answers  


what are the two (2) parameters available in python map?

0 Answers  


Difference between __str__ and __repr__?

0 Answers  


What are the attributes?

0 Answers  


Categories