How to print numbers between two numbers in python

We were given an exercise where a user must input two numbers and the output must be the numbers between the two given numbers, with the condition that the only input are numbers, and if the user types anything besides that will print "INVALID INPUT!"

Here is what I have tried:

num1 = int[input['Give me a #:']]

num2 = int[input['Give me another#:']]


if num1>num2

print["First number should be lesser than second number"]


elif num1 = 1 ]:.
print [i, end = ' ' ] i = i - 1..

How do you print between in Python?

append[i] print[f'First number: {num1}n\Second number: {num2}'] print[f'The numbers between {num1} and {num2} are:\n{num_list}'] break except: print["Input must be a number. Try again. "]

Chủ Đề