नीचे दिए गए कोड स्निपेट में 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
Str and int
B
int and int
C
str and str
D
int and str
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.
Correct Answer: D) int and str