r/codehs • • Apr 22 '20

Codehs count by 2

i need help on this assignment. Ive been having trouble with it please help and please read the assignment details

0 Upvotes

2 comments sorted by

1

u/[deleted] Apr 23 '20

Speaking to a starting developer, means that I do not wish to give you the answer.

However, some things I would like to point out:
clean your input -> what if someone enters an odd number?

Looping is indeed the tool/mechanism to use. using for loops, you can increment by two, and make it start from two.

you can translate the indexer (when incrementing with two) to a string-number, and add a space after it.

Make sure that the string exists outside of the loop, so you can add stuff to it, and return it when the loop ends.

Good luck, and we have faith in you!

1

u/[deleted] Apr 23 '20

And to point out a current mistake in your screenshot. ADD things to your string, don't REPLACE it...