Q. Type following code (as it is) in the new window opened by IDLE

print ("Hello Nathan", "Hello Lalit")
greet1 = "Hello Nathan"
greet2 = "Hello Lalit"
name1 = "Nathan"
name2 = "Lalit"
print (greet1, greet2)
print ("Hello", name1, ",", name2)
name1 = "Purvi"
name2 = "Hunar"
print ("Hello", name1, ",", name2)
* Save program file:- Save the file by pressing Ctrl+S or File → Save command

* Run program:- Click Run → Run Module command or press F5.

Notice the output and compare it with code.


Answer :-

Output :-

Hello Nathan Hello Lalit
Hello Nathan Hello Lalit
Hello Nathan , Lalit
Hello Purvi , Hunar
>>>

We notice that values of variables (name1 and name2) are change. Now new values are Purvi and Hunar of variables name1 and name2 respectively.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post