I need help writing the following program in python that I can write easily with for, if, else, but I don't even know how to start when I have to use while. Happy for any input and ideas
Write a program that uses if and while that does the following: • Asks the user to enter two odd numbers • Create a list that contains all odd numbers between them (including the entered numbers) • If the entered numbers are not odd the program should print an error message, and then stop. • If the first entered number is larger than the second one, the program should still be able to print all the odd numbers between them (and the numbers themselves) in descending order. • Print this list in descending order.
Aucun commentaire:
Enregistrer un commentaire