- A python program that keeps numbers in words in a list (in chronological order), i.e. One, Two, Three…, up to Ten.
- Ask the user to enter a number.
- Display the corresponding number in words from the list. For example, if the user types in ‘1’, display One.
- Ask the user to enter a number to be deleted from the list.
- Display the new list.
I defined a list of numbers in words at first, then it asks the user to enter a number from 1 to 10 and the question appears again if a wrong number is entered. After a word of number shows, a question for entering a number to be deleted appears and it will keep asking if the user enters a wrong number. Finally, the number entered by the user will be converted to the index of the list and that number word will be deleted in the list.
Self-reflection: I have added an extra while function to check if a user enters any number out of 1 to 10. Otherwise, the program will keep asking users to enter a number until a number in the range is entered.