title: How to learn possible type of an object in a string?
body: <p>In python I have string examples as following:</p>
  <pre><code>str1= &quot;True or False and True&quot;
  
  
  str2=&quot;6.4 * 32 + 43 -21+(3.4 + 2.0)&quot;
  </code></pre>
  <p>now I want to learn both types of all elements of strings and learn the value of whole string</p>
  <p>1)</p>
  <pre><code>for a in str1.split():
    #write some code here and this will print the following output
  
  #print(a and exact_type) 
  # a is True and type is bool
  # a is False and type is bool
  # a is True and type is bool
  # and value of str1 is True type is bool
  
  
  </code></pre>
  <ol start="2">
  <li></li>
  </ol>
  <pre><code>for b in str2.split():
     # write some code here and this will print the following output
  # print(a and exact_type)
  # b is 6.4 and type is float
  # b is 32 and type is integer
  # b is 43 and type is integer
  
  #value of str2 is 232.20000000000002 and type is float
  </code></pre>
  <p>I know all of them is of type string but I want to learn possible type, pure type</p>
  <p>edit:
  clarification:
  i am trying to find a value of bunch of strings that is given me in this form. for example, str3=&quot;True + 34&quot; will give me error. because it can not be evaluated. in string i could have various objects. integer, float, boolean, variable that is defined before etc. since all of them in a string I could not learn type of objects. I know all substring is of type string but I should get the type ignoring object is in a string</p>