How to write a summation in Julian?

How to write and solve a summation in Julian?

sum

2 Likes

How do I add the, summation index, the first value, the last favor and of course the formula for the terms?

e.g. y = sum(i^2 for i in source) or sum(source[starti:step:endi]) ?

In a terminal, click ? and enter. This will lead you to the help prompt where you can just type sum + enter to get the documentation (with examples) of the sum function.

That’s the package management prompt. Type ? at the prompt to enter help mode.

2 Likes

Welcome to Julia discourse!

I also find the docs quite helpful, where you can find more examples as well

https://docs.julialang.org/en/v1/base/collections/#Base.sum

1 Like

yup, corrected, tk