Luuk writes:
...
> Maybe i should have asked this:
>
> What is the difference between 'type(5)==int' and 'isinstance(5,int)'
>
> and, if there is no difference why did someone invent 'isinstance()' ...
Look:
Python 3.6.6 (default, Aug 13 2018, 18:24:23)
[GCC 4.8.5 20150623 (Red Hat
Luuk writes:
> On 12-5-2019 16:07, Piet van Oostrum wrote:
>> Luuk writes:
>>
>>> After thinking about this, (i am prettry new to python), i was doing this:
>>>
>> print(type(5),type(int),type(5)==type(int),type(5)==int)
>>> False True
>>>
>>> Can someone explain why type(5)==int
On 12-5-2019 16:07, Piet van Oostrum wrote:
Luuk writes:
After thinking about this, (i am prettry new to python), i was doing this:
print(type(5),type(int),type(5)==type(int),type(5)==int)
False True
Can someone explain why type(5)==int evaluates to True ?
print(int)
The
Luuk writes:
>
> After thinking about this, (i am prettry new to python), i was doing this:
>
print(type(5),type(int),type(5)==type(int),type(5)==int)
> False True
>
> Can someone explain why type(5)==int evaluates to True ?
>
>>> print(int)
The value of int is the class int,
On 12-5-2019 10:16, Luuk wrote:
On 12-5-2019 09:27, binoythomas1...@gmail.com wrote:
When I run the following code, I get the following output:
print(type(5))
class 'int'
Next, I try to compare the data-type of 5 with the earlier output, I
get no output:
if type(5) == "":
binoythomas1...@gmail.com writes:
> When I run the following code, I get the following output:
print(type(5))
> class 'int'
>
> Next, I try to compare the data-type of 5 with the earlier output, I
> get no output:
if type(5) == "":
> print("Integer")
>
> Why isn't this working?
On 12-5-2019 09:27, binoythomas1...@gmail.com wrote:
When I run the following code, I get the following output:
print(type(5))
class 'int'
Next, I try to compare the data-type of 5 with the earlier output, I get no
output:
if type(5) == "":
print("Integer")
Why isn't this