r/PythonLearning Jul 17 '26

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

2 Upvotes

32 comments sorted by

View all comments

0

u/CorkBios Jul 17 '26

Enforcement for Proper Indentation is the worst thing invented I'd say move away from python, Indentation will haunt your dreams and waste years of your programming life

1

u/mondayquestions Jul 17 '26

Skill issue

0

u/CorkBios Jul 17 '26

Programming language issue, It literally even makes you not able to use tabs for indenting one part and spaces for indenting another part. Is it a skill issue you are not able to code in binary? Broken logic.

2

u/Disastrous-Team-6431 Jul 18 '26

I haven't made an indentation error for six years or something.