Skip to main content
1 of 2
blhsing
  • 109.1k
  • 9
  • 88
  • 132

You can use ast.literal_eval() instead to parse the string returned by the input() function into an object represented by the content of the string, so that you can use isinstance() to test its type as you intended:

import ast
valor = ast.literal_eval(input())
blhsing
  • 109.1k
  • 9
  • 88
  • 132