0 votes
1 view
in Python by (47.8k points)

How can I check if a Python object is a string (either regular or Unicode)?

1 Answer

0 votes
by (107k points)

There are many ways to find out that a Python statement is a string:-

The first thing you can use isinstance(obj, basestring) for an object-to-test for a string.

Another way you can use is type(o) it will also tell you that the Python object is a string.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Sep 27, 2019 in Python by Sammy (47.8k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...