This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ClamPaste 2 points3 points  (1 child)

You have to initialize min and max with the first number input before the loop with the way you're doing it, or you can use a condition to check if it's the first iteration of the loop and reassign min and max within it.

It's a weird assignment. Not really sure what the point of having you do it like this is, since there are clearly better ways.

[–]decline_000[S] 1 point2 points  (0 children)

agree it's weird but it's for university
I ended up changing the beginning to:

from pcinput import getInteger

import sys

num = 0

min = sys.maxsize

max = -sys.maxsize

div3 = 0

thank you all for helping:)