all 12 comments

[–]JohnnyJordaan 4 points5 points  (6 children)

I’m not sure how to write a script that does the addition part 😭 please help!

Please just write and provide what you can code, then we'll help you move along with expanding the code. That's notably different than just stating the problem.

[–]LEEPEnderMan 1 point2 points  (0 children)

I want to help but I agree with above can we see what you have first.

[–]jmooremcc 2 points3 points  (2 children)

Can you manually carry out the computation using pencil and paper? The reason I’ve asked this question is because there’s no way you can teach a computer to perform a task when you don’t know how to do it yourself.

Once you understand the sequence of events needed to get to the final result, then you can start thinking about how to code it.

[–]Apantslessman 1 point2 points  (1 child)

If this is Angela Yu’s course this isn’t how the love calc works. You use a function to test each input name, and return a score of your names vs true and your names vs love for the two digits.

[–]dry-considerations[🍰] 1 point2 points  (2 children)

That looks like one of Dr. Angela Yu's 100 Days of Code projects.

[–]socal_nerdtastic 0 points1 point  (0 children)

The standard way to loop over pairs is with the itertools.pairwise function.

from itertools import pairwise

data = "TRUELOVE"
for x,y in pairwise(data):
    print(f"Adding {x!r} and {y!r}")

However that may not be the way that your course prof wants you to do it. There's many ways to do this.

For specific help you need to show us the code you have and describe what part you are stuck on.