There are many things about your question that I don't fully understand. The least important is whether you meant the loop to go over k rather than i. If not, then I don't understand how i is supposed to be used.
Most importantly, I don't really understand what you mean by "simultaneously" here. Do you mean that you want to somehow execute
in a single line of code?
Why? These two lines of code do not affect each, and could be executed in either order, with same result.
You could define a function that returns a and d "simultaeously", but I'm not sure of the point of that.
Maybe I just don't fully understand your question.