2 i) What is the problem with the following code fragment?
a=7
print(a)
b=3
print(b)
s= a + b
print(s)
ii) What is the difference between a simple statement and a compound statement in Python?
iii) What is mutable and immutable?
iv) What is the difference between while() and for()loop.
v) What is data type? Write the name of any four data types.
vi) What do you mean comments? How are they written in Python?
Answers
Answered by
2
2.Compound statement are those like the if and while statement which require a multiple lines For Example:X=4 is a statement and not an expression but X=4 ,Y=5,Z=6 is a valid python line because assignment is a simple statement and multiple simple statement may be seperated
3. An immutable object is a kind of object whose statement cannot be modified after it is created where a mutable object can be modified after it is created
for example:boolean, byte, character, double flute, integer, anda and string are immutable object
I hope my answer will help me my dear friend please mark me as brain list
Similar questions