Q. In a Python Shell, (on the Python prompt) assign the following data to different variables namely var1, var2, var3, var4 and so on respectively.

(DO NOT ADD OR REMOVE QUOTES FROM THE DATA GIVEN BELOW)

True, 'True', False, 'False', 'true', true, 'false', false

Log in the following table the result returned by Python after each assignment.

(Note: First try in a Python Shell and then fill the following table.)

 
S.No Value Assignment Statement to assign the value to a variable What Python returned?
1. True
2. 'True'
3. False
4. 'False'
5. "true"
6. true
7. 'false'
8. false
Answer :-
S.No Value Assignment Statement to assign the value to a variable What Python returned?
1. True var1 = True >>> var1
True
2. 'True' var2 = 'True' >>> var2
'True'
3. False var3 = False >>> var3
False
4. 'False' var4 = 'False' >>> var4
'False'
5. "true" var5 = 'true' >>> var5
'true'
6. true var6 = true It will give error that true is not defined.
7. 'false' var7 = 'false' >>> var7
'false'
8. false var8 = false It will give error that false is not defined.

1 Comments

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

Post a Comment

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

Previous Post Next Post