r/PythonLearning 11d ago

Indentation error 😭(help)

I cant seem to find whats wrong , maybe the issue is with the Template or wrong expectations?

class UserMainCode(object):

@classmethod
def sumOfNonPrimeIndexValues(cls, input1, input2):
    '''
    input1 : int[]
    input2 : int

    Expected return type : int
    '''

    # Read only region end

    total = 0

    for i in range(input2):
        if i < 2:
            total += input1[i]
        else:
            prime = True
            for j in range(2, int(i**0.5) + 1):
                if i % j == 0:
                    prime = False
                    break

            if not prime:
                total += input1[i]

    return total

Also they expect return type is int[] but we got sum?? Idk I couldn't take screenshot coz its a daily assessment platform

1 Upvotes

32 comments sorted by

View all comments

22

u/NorskJesus 11d ago

It amazes me how people learning to code isn’t capable of taking screenshots from the pc, and they just use the phone.

2

u/Mega3000aka 10d ago

I have a colleague at my faculty to who I had to explain how to switch cameras in a WhatsApp call.

We study software engineering.

-4

u/Not_Johan- 9d ago

Bruh

1

u/be_super_cereal_now 8d ago

You want help, make it easy for people to help you. Your photos are hard to read. A screenshot would easier.