Ask the user for two positive integers; the first number, a, should be less than the second number, b. Print the average of the numbers from a to b inclusive. [ For example: If the user enters 3 and 7, the code should print 5 ((3+4+5+6+7)/5). ] (python coding)

Respuesta :

What you need to do here is increment. Begin by asking the user for the two inputs like you were ( one smaller than the other ) then you would need a loop that kept creating new integers until the desired maxNum is reached. I can write this in Java but not python. in java you would need a 'while loop' and the incrementation '++'. So int1 = 3 and int2 = 7
While (int1 < int2; int++) {
     intAverage = (('integers')/integers.length();
}