|
Two quick solutions I could think of.
1. You can take the easy route by inserting all inputs into a list, sorting it, and taking the first two values.
2. Obviously, you can keep track of two numbers instead of one in your loop. It only takes a little bit of thinking on how you would update those variables as you get each input.
|