class 11 python
_________________________
please help.!!!!!!!
Answers
Hi,
17.=> x = y = 7
I already know that yo do not know what operator precedence is, you have to understand what it is only than you will be able to answer this question
So here id the definition of Operator precedence:-
Operator precedence determines the way in which operators are parsed with respect to each other. Operators with higher precedence become the operands of operators with lower precedence.
x = y = 7
= operator is right to left based
so we are assign (y = 7) first and than x = (y = 7),
so x is equals to 7 and y is also equals to 7
___________________________________________
18) x, y = 7
To understand what we are doing in above line of code we have to understand a word "iterable"
iteratble means an object that can be iterated upon.
in above code we are trying to iterate over 7 and assign those values to x and y respectively
but 7 is a number that means it's data type is int, and in python int is not iterable.
so it will generate an error.
check screenshot.
Answer:
visit my channel to learn python
link
https://www.youtube.com/channel/UCUvsNL0uc7RLBigtudfPniw
Explanation: