Put the code inside a main function for better organization and readability. Check if the 'names' package is installed only once at the beginning. Use a for loop to simplify the counting logic.
Added a conditional check to make sure the entered number is within the desired range. Improved the formatting of the input prompt and output message for better user experience.
Put the code inside a main function for better organization and readability. Check if the 'names' package is installed only once at the beginning. Use a for loop to simplify the counting logic. Added a conditional check to make sure the entered number is within the desired range. Improved the formatting of the input prompt and output message for better user experience.