0

This question is how to define same variable for two values using python.

min_lat = 10
min_lat = lower_right_lat = lower_left_lat

I should get the result for both the lower_right_lat and lower_left_lat to be 10.

2
  • 1
    If you are trying to set lower_right_lat and lower_left_lat, just reverse the order of your assignment: lower_right_lat = lower_left_lat = min_lat Commented Jul 25, 2013 at 0:18
  • @Pathétique: Please put answers in answers, not in comments. Commented Jul 25, 2013 at 1:16

1 Answer 1

6

Simply change the order of assignment:

lower_right_lat = lower_left_lat = min_lat

The statements are evaluated from right to left.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.