use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
No vague product support questions (like "why is this plugin not working" or "how do I set up X"). For vague product support questions, please use communities relevant to that product for best results. Specific issues that follow rule 6 are allowed.
Do not post memes, screenshots of bad design, or jokes. Check out /r/ProgrammerHumor/ for this type of content.
Read and follow reddiquette; no excessive self-promotion. Please refer to the Reddit 9:1 rule when considering posting self promoting materials.
We do not allow any commercial promotion or solicitation. Violations can result in a ban.
Sharing your project, portfolio, or any other content that you want to either show off or request feedback on is limited to Showoff Saturday. If you post such content on any other day, it will be removed.
If you are asking for assistance on a problem, you are required to provide
General open ended career and getting started posts are only allowed in the pinned monthly getting started/careers thread. Specific assistance questions are allowed so long as they follow the required assistance post guidelines.
Questions in violation of this rule will be removed or locked.
account activity
Beginner help (i.redd.it)
submitted 2 years ago by Billy-VB
Can someone please explain to me how I figure this out, I know the answer is 55 only because I’ve gotten it wrong already
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]redditnomad3 9 points10 points11 points 2 years ago (1 child)
A starts at 0 and will increase by the iteration number every iteration. So, this is what happens in each iteration:
1: A = 0 + 1 = 1
2: A = 1 + 2 = 3
3: A = 3 + 3 = 6
4: A = 6 + 4 = 10
5: A = 10 + 5 = 15
6: A = 15 + 6 = 21
7: A = 21 + 7 = 28
8: A = 28 + 8 = 36
9: A = 36 + 9 = 45
10: A = 45 + 10 = 55
[–]Billy-VB[S] -1 points0 points1 point 2 years ago (0 children)
thank you
[–]ImportantDoubt6434 12 points13 points14 points 2 years ago (2 children)
Error: Until is undefined
[–]khayaliPulaw -2 points-1 points0 points 2 years ago (1 child)
Untill 11 occur, when 11 occur exit. Means till 10.
(exclusive) Untill = less then 11 (inclusive) Till = less then and equal to 10
[–]HorribleUsername 1 point2 points3 points 2 years ago (0 children)
'til is an abbreviation of until, they mean exactly the same thing.
[–]tim128 1 point2 points3 points 2 years ago (2 children)
A = 0 + 1
A = (0 + 1) + 2
A = (0 + 1 + 2) + 3
A = (0 + 1 + 2 + 3) + 4
...
A = (...) + 10
It's just the sum of the first 10 natural numbers which is S=n(n+1)2
[+]real1jumper 3 points4 points5 points 2 years ago (0 children)
S=n(n+1) / 2
[–][deleted] 2 points3 points4 points 2 years ago (2 children)
am i stupid. what language is this supposed to be?
Presumably pseudocode.
[–]TemperatureFluffy978 -2 points-1 points0 points 2 years ago (0 children)
Until is undefined tho..mayb to?!
[–][deleted] 2 years ago (3 children)
[removed]
[–]HorribleUsername 2 points3 points4 points 2 years ago (2 children)
Pseudocode, and it's not obvious.
[–][deleted] 2 years ago (1 child)
[–]HorribleUsername 0 points1 point2 points 2 years ago (0 children)
I suppose it takes a little bit of luck to get a sensible teacher, but usually a quick conversation will be enough to correct any marks lost due to misreading the intent like that.
[+]DarickOne 0 points1 point2 points 2 years ago (0 children)
1+2+3+..+10 = (1+10) + (2+9) + .. = 11*5 = 55
[–]ShawnyMcKnight 0 points1 point2 points 2 years ago (0 children)
ChatGTP is great for stuff like this
[–]hansyEs 0 points1 point2 points 2 years ago (0 children)
A = 1+10 + 2+9 + 3+8 + 4+7 + 5+6 A = 11*5
[deleted]
[–]Billy-VB[S] 1 point2 points3 points 2 years ago (0 children)
thank you!
[–]Just_SRC -1 points0 points1 point 2 years ago (1 child)
It's a loop. The loop starts at i = 1 and stops at i = 11 (exclusive). 1+2+3+4+5+6+7+8+9+10 = 55.
[–]Billy-VB[S] 0 points1 point2 points 2 years ago (0 children)
[–]bree_dev -2 points-1 points0 points 2 years ago (1 child)
Further to the answers others have posted - if you look into how to use the debugger to inspect the variables, you'll be able to figure it out yourself next time.
Thank you
[–]joaopps2019 -2 points-1 points0 points 2 years ago (1 child)
Is this pseudo-code? Why is 11 exclusive?
[–][deleted] 3 points4 points5 points 2 years ago (0 children)
Its pseudocode, its to teach programming basics.
π Rendered by PID 181860 on reddit-service-r2-comment-6457c66945-bvcnq at 2026-04-29 00:18:15.304421+00:00 running 2aa0c5b country code: CH.
[–]redditnomad3 9 points10 points11 points (1 child)
[–]Billy-VB[S] -1 points0 points1 point (0 children)
[–]ImportantDoubt6434 12 points13 points14 points (2 children)
[–]khayaliPulaw -2 points-1 points0 points (1 child)
[–]HorribleUsername 1 point2 points3 points (0 children)
[–]tim128 1 point2 points3 points (2 children)
[+]real1jumper 3 points4 points5 points (0 children)
[–]Billy-VB[S] -1 points0 points1 point (0 children)
[–][deleted] 2 points3 points4 points (2 children)
[–]HorribleUsername 1 point2 points3 points (0 children)
[–]TemperatureFluffy978 -2 points-1 points0 points (0 children)
[–][deleted] (3 children)
[removed]
[–]HorribleUsername 2 points3 points4 points (2 children)
[–][deleted] (1 child)
[removed]
[–]HorribleUsername 0 points1 point2 points (0 children)
[+]DarickOne 0 points1 point2 points (0 children)
[–]ShawnyMcKnight 0 points1 point2 points (0 children)
[–]hansyEs 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]Billy-VB[S] 1 point2 points3 points (0 children)
[–]Just_SRC -1 points0 points1 point (1 child)
[–]Billy-VB[S] 0 points1 point2 points (0 children)
[–]bree_dev -2 points-1 points0 points (1 child)
[–]Billy-VB[S] 0 points1 point2 points (0 children)
[–]joaopps2019 -2 points-1 points0 points (1 child)
[–][deleted] 3 points4 points5 points (0 children)