||||||||||||||||||✨Hello✨|||||||||||||||||||||
_______________________
class11 python ❤
How the output came......
Step wise solution else reported!!
_______________________
Answers
Hi,
It is very simple...
1) x, y = 7, 2
2) x, y, x = x + 1, y + 3, x + 10
3) print (x, y)
in firt line we are saying that:
x = 7 and y = 2
you have to look at it very carefully if you wanna understand what is going on in this line, break down that line in to pieces from = symbol
x, y, x
x + 1, y + 3, x + 10
we can simplify it like below to understand what's going on here
x = x + 1 # here we are assigning x + 1 means 8 to variable x
y = y + 3 # in this line we are asssigning
x = x + 10 # and in this line we again assigning x + 10 means 17 to variable x
so now x is equals to 17 because above line of code overrided that previous value and y is equals to 5
so the print function will print 17, 5 on the output screen
check screenshot to see output of python IDLE