Q. Identify Operators Practice (Interactive mode)
x = 29.0, y = 13, z = 2, p = 0.5, q = 12.79, i = 13, j = 29.0, k = y – 11, a = ''(empty string), b = '', c = 'great', d = 'Great', e = 'GREAT', f = 'Great', g = 'GREAT', h = ' great', l = (3 + 4.5j), m = (3 + 4.5j)
| S. No. | Expression | Result | Reason |
|---|---|---|---|
| 1 | y == 13 | ||
| 2 | y == i | ||
| 3 | y is i | ||
| 4 | g == e | ||
| 5 | g == e | ||
| 6 | e is not g | ||
| 7 | k == z | ||
| 8 | z is not k | ||
| 9 | l == m | ||
| 10 | l is m |
Answer :-
| S. No. | Expression | Result | Reason |
|---|---|---|---|
| 1 | y == 13 | True | Both have same id (memory address). |
| 2 | y == i | True | Both have same id (memory address). |
| 3 | y is i | True | Both have same id (memory address). |
| 4 | g == e | True | Both variables have same value and have same id. |
| 5 | g == e | True | Both variables have same value and have same id. |
| 6 | e is not g | False | ‘not’ operator give opposite of answer. |
| 7 | k == z | True | Both variables have same value and have same id. |
| 8 | z is not k | False | ‘not’ operator give opposite of answer. |
| 9 | l == m | True | Both variables have same value and have same id. |
| 10 | l is m | True | Both variables have same value and have same id. |
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )