fork download
  1. # your code goes here
  2. s = ["test"];
  3. #s = "test";
  4. isString = False;
  5.  
  6. if(isinstance(s, str)):
  7. isString = True;
  8.  
  9. try:
  10. if(isinstance(s, basestring)):
  11. isString = True;
  12. except NameError:
  13. pass;
  14.  
  15. if(isString):
  16. print("String");
  17. else:
  18. print("Not String");
Success #stdin #stdout 0.01s 7852KB
stdin
Standard input is empty
stdout
Not String