Computer Science, asked by NidhraNair, 11 months ago

||||||||||||||||||✨Hello✨|||||||||||||||||||||
_______________________

class11 python ❤

How the output came......
Step wise solution else reported!!
_______________________

Attachments:

Answers

Answered by subham237
3
hiii the main reason is above x=7 and y=2 and down it is written as 1 and 3 when it coincides with x and y then (x,y)=17 and 5
Answered by Anonymous
2

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




Attachments:

nitish8089: due python is interpeting language...
nitish8089: it also a reason...
nitish8089: what you say??...
Similar questions