I have come across a problem in Clash in Code
12:17 17 Jan 2026

The problem statement is that is to find the difference between the maximum and minimum of the given set of numbers.

The input will be as follows

3

4

5

6

and we need to write a code find the difference between the maximum and minimum. But this is not the actual problem here when writing the code I had to create each variable for each input from the console and put them in array. This is very time taking and manual effort

Is there a way where we can automatically read each number from the console and put them in array.

Note that each number from console will not be in a same line but a new line. How can we write the program to close the input taking after the last number is entered.

There will be no ctrl+z or ctrl+d or asking how many numbers or any things as such just numbers on each line

python