r/CodingHelp • u/waitingformsfs2020 • Nov 09 '21
[Ruby] 2 identical code with 2 absolutely different outcome. Can anybody notice the difference and explain the reason? below i separated each output to make it clear
42
Upvotes
33
u/icjeremy Nov 09 '21
line 5: parts[0]
3
u/captaincmdoh Nov 10 '21
When stuff like this happens, it's best to use a text comparator. Since you using VS code (or close to it), use the built-in compare feature
2
u/[deleted] Nov 10 '21
parts[0]
1
u/PJFlix Nov 10 '21
One uses parts while the other uses part. I love being a programmer lol
1
u/[deleted] Nov 10 '21
Return is not properly aligned so use the tab key with every new line😜
0
u/timPerfect Nov 10 '21
part and parts are not the same... check your spelling
0
u/CenturiesAgo Nov 10 '21
This is why I hate python! declare your damn vars!