0

Could Someone please explain me the things in the picture broadly?

Please explain why they used so many var. Like addressing a variable with var multiple times and it printed out. Can we give multiple strings to a single addressed variable? For example, in the picture, they have given variable var=8, again var=3.1416...so nd so. Can we give multiple entry like this to a single variable and it would be able to run successfully or there is something else that need to be explained. I didn't understand this thing. Someone please explain it to me. For ur information, the picture is available in my profile feed or in this link https://photos.app.goo.gl/zdhamWFnit56kMvH7 In case the 1st code link doesnt work.

29th Nov 2019, 9:09 PM
md0
md0 - avatar
4 Answers
+ 6
Muhammad Osama Bin Absar You can re-declare the variable even after you have declared it once. it's may be because python variable is pointing to different object at different point due to again and again overwriting and assign new value or declarations A Python variable is a reserved memory location to store values so every time when you declare variable that will be store in new object and memory location The memory block remains but it now points to a new objects you can show that in this below code where assign object id is changing var = 8 print(id(var)) var = 3.412 print(id(var)) var = "tyson" print(id(var)) var = True print(id(var))
29th Nov 2019, 9:25 PM
GAWEN STEASY
GAWEN STEASY - avatar
+ 2
Please first remove all tags add only python Because it's related to python. There is a single variable defined. Just assigning different values to that var everytime to print that values. Either you can print value directly or you can assign to any variable and print that variable.
29th Nov 2019, 9:23 PM
A͢J
A͢J - avatar
+ 1
sneeze Don't open code just click on link above the code which is image link. The program is related to Python.
29th Nov 2019, 9:25 PM
A͢J
A͢J - avatar
0
Please check the path of your image. The image does not show. What is the language shown in the image ?
29th Nov 2019, 9:23 PM
sneeze
sneeze - avatar