3.4.0 For loops common mistake

Sign in to test your solution.
sum_of_first_n_numbers <- function(n) { for (i in 1:n) { sum <- 0 sum <- sum + i } return(sum) }
You can submit as many times as you like. Only your latest submission will be taken into account.
Sign in to test your solution.