Python datatype

SIR,
What is the difference between Integer datatype and Tuple datatype

1 Like

Dear Learner,

Welcome to LearnVern! We are happy to serve you.

Hi harshita!
Integer is a numerical datatype that stores only integers, on the other hand Tuple is a container that can store multiple values of any data type, provided that they are separated by a comma(,).

Also a variable holding an integer data type can be updated (hence called mutable)
ex: a = 3,
a = a + 1
now a = 4,
but a variable holding tuple datatype cannot be updated (hence called immutable)
ex: a = (3, ‘hello’),
a[0] = 4 will throw an error.

We hope our reply serves your query well.
Keep learning.


Thanks and Regards,
Siddhant
Team LearnVern.

Sir mujhe kuch dikkete aa rahi hai
a = true
print(type(a))

b = 10
print(type(b))
NameError Traceback (most recent call last)
Input In [5], in <cell line: 1>()
----> 1 a = true
2 print(type(a))
4 b = 10

NameError: name ‘true’ is not defined
Maine toh sir pura sahi kiya jaisa apne bataya tha phir ye error kyon aa raha hai.

ye mujhe be problem aa rha hai