On Thursday, April 23, 2020 at 6:46:14 PM UTC-7, Alan Bawden wrote:
> Deac-33 Lancaster <dea...@gmail.com> writes:
> 
> > I'm aware that you can find the type of a variable with 
> >    type(var)
> 
> (Strictly speaking, variables don't have types.  This gives you the type of
> the variable's current value.  But we know what you meant.)
> 
> > But are there Boolean operators in Python3.8 to test the data type, e.g.
> >   is_floate(var)
> >   is_string(var)
> > etc. ?
> 
> You should probably be using isinstance(), as in:
>   isinstance(var, float)
>   isinstance(var, str)
> 
> -- 
> Alan Bawden

Alan,
Much thanks for the response.   Yes, dynamic typing so it can change.  But this 
is what I was looking for, unable to find it in the docs, need more practice at 
that.  :-) 
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to