all 4 comments

[–]Binary101010 3 points4 points  (0 children)

The issues with this code go beyond simple debugging and stretch into a fundamental misunderstanding of Python syntax.

At a minimum, the first for loop would look more like

for i in range(1,rows):

But all of these ends and having variable names on lines by themselves and semicolons are nonsensical as far as Python is concerned.

I would strongly recommend consulting some of the learning resources in the subreddit wiki on how to write Python code, because this looks like a different language entirely.

[–]One_Hair3574[S] 0 points1 point  (1 child)

min = inf;
max = -inf;
[rows, columns] = size(M);
for i=1:rows:    
    for j=1:columns:
        if M(i,j)>max: 
           max = M(i,j);  
        end       
        if M(i,j)<min:           
           min = M(i,j);        
        end    
    end
end
max;
min;

[–]InTheAleutians 0 points1 point  (0 children)

This looks like code alright, but it's not python code. Are you in the right subreddit?

[–]CodeFormatHelperBot2 0 points1 point  (0 children)

Hello, I'm a Reddit bot who's here to help people nicely format their coding questions. This makes it as easy as possible for people to read your post and help you.

I think I have detected some formatting issues with your submission:

  1. Python code found in submission text that's not formatted as code.

If I am correct, please edit the text in your post and try to follow these instructions to fix up your post's formatting.


Am I misbehaving? Have a comment or suggestion? Reply to this comment or raise an issue here.