The answer is 14328 as per my code
RE: 01. LPTHW (A Good First Program - ex1.py) || Announcement of the winners of the last challenge. || New challenges at the end.
You are viewing a single comment's thread from:
01. LPTHW (A Good First Program - ex1.py) || Announcement of the winners of the last challenge. || New challenges at the end.
I've upvote you, now it's your turn upvote my post @abiismail
please go to the link below
https://steemit.com/travel/@abiismail/belanja-hemat-di-swalayan-nanggroe-
637b52e3706bc
https://steemit.com/travel/@abiismail/suasana-piknik-pagi-di-pantai-laut-syiah-kuala-e0e6fadf3b145
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey @bsameep! Please do format the code, makes it easier to read. :D
You can check the previous submissions for reference.
Also, the limit is 400000, not 40000.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey sorry, but the code will work if u change 40000 to 400000... Here is the updated one...
len <- 100
fibvals <- numeric(len)
fibvals[1] <- 1
fibvals[2] <- 1
for (i in 3:len)
{
if(fibvals[i-1]+fibvals[i-2] > 400000)
{
break
}
else
fibvals[i] <- fibvals[i-1]+fibvals[i-2]
len = len+1
}
fibvals
sum(fibvals[fibvals %% 2 ==0])
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Right now m holidaying at Western coastal area... Won't get chance to run d code n reproduce the answer...
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Umm okay, do try formatting it for readability though.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit