Check is its string

Code examples

0
0

# Python3 code to demonstrate
# Check if variable is string 
# using isinstance()
  
# initializing string 
test_string = "GFG"
  
# printing original string 
print("The original string : " + str(test_string))
  
# using isinstance()
# Check if variable is string 
res = isinstance(test_string, str)
  
# print result
print("Is variable a string ? : " + str(res))

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................