नीचे दिए गए कोड स्निपेट में var का डेटाटाइप क्या होगा?
What will be the datatype of the var in the below code snippet?
var = 10
print(type(var))
var = "Hello"
print(type(var))
A)
B)
C)
D)
Explanation:
The variable var
first holds an integer 10
(so its type is int
), and then it holds a string "Hello"
(so its type becomes str
).
So, the answer is (D) int and str.