Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

for range – invalid syntax of loop

def amp1(array):
    for i in range (0,len(array),400)
    amp1 [array]= abs(max(array[i:i+400]))
    return amp1

print(amp1(node1[3]))

I get this response:

File "<ipython-input-53-972793b81fd0>", line 7
    for i in range (0,len(array),400)
                                     ^
SyntaxError: invalid syntax

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You are missing a ":" at the end of line 7.
Let try like:

def amp1(array): 
    for i in range (0,len(array),400): 
        amp1 [array]= abs(max(array[i:i+400])) 
    return amp1

print(amp1(node1[3]))

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading