Python Programming - Variables - Discussion

Discussion Forum : Variables - General Questions (Q.No. 7)
7.
What is the value of x after executing the following code?
x = 5
x = "IndiaBIX"
5
"IndiaBIX"
"5"
An error is raised
Answer: Option
Explanation:
In Python, variables can be assigned to different data types. When a variable is assigned to a new value, the old value is overwritten with the new value. In this case, the variable x is first assigned to the integer 5, but is then reassigned to the string "IndiaBIX".
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.