I am a newbie to programmimg and python.
When I do:
j = 100
k = 200
l = j + k
l
300
Now, if I change the value of J, I expect the output of ‘l’ to be different. Why is the output same and how can I make it change.
j = 250
l
300
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That’s not what “dynamic” means. Once a value is assigned to a variable, the variable retains that value until it is assigned a different value.
Dynamic languages are those whose variables can take on any type at runtime, and usually can even hold multiple values of different types over their lifespan:
That said, you can achieve something similar to what you expected: