I'm trying to implement a conditional branch based on a variable type.
For example, if c is a character and s is a set with only one member.
c = "9"
s ={9}
if type(c) == a string:
do this
else:
do that
An alternative that I've attempted is to test if a set contains one member
ba
Phil writes:
> I'm trying to implement a conditional branch based on a variable type.
This is often (not always) a mistake, in Python. So the question needs
to be asked: What makes you think that condition is a requirement?
In other words, why is the data such that you *need* to know whether it
Hello and greetings Phil,
>> I'm trying to implement a conditional branch based on a variable type.
>
>This is often (not always) a mistake, in Python. So the question needs
>to be asked: What makes you think that condition is a requirement?
>
>So, I suspect you will need to explain better what l