What will be the output of this program?
a = 20.3
b = ‘Python’
c = ‘"Python"‘
d = 21
print isinstance(a, float),
print isinstance(b, (str, int)),
print isinstance(c, (str, str)),
print isinstance(d, (float, str))
Answers
Answered by
0
C - Inyyhfgbput and Output in
Answered by
0
The output is as follows:
a = 20.3
b = ‘Python’
c = ‘"Python"‘
d = 21
print isinstance(a, float), // to check whether a is float or not
print isinstance(b, (str, int)), // to check whether b is int ot not
print isinstance(c, (str, str)), // to check whether c is string or not
print isinstance(d, (float, str)) // to check whether d is string or not
Output :
True
True
True
False
Similar questions
Computer Science,
11 months ago
Math,
1 year ago