Programming Assignment Unit 5
Programming Assignment Unit 5
Explanation
1. Accepting User's Name:
- The input() function is used to get the user's name. This function returns a string.
- The input is stored in the variable name.
Explanation
1. Accepting User's Name:
o The input() function is used to get the user's name. This function returns a string.
o The input is stored in the variable name.
2. Defining Vowels:
o A string vowel is defined containing all lowercase and uppercase vowels.
3. Counting Vowels:
o The code uses a generator expression within the sum() function to count the
number of vowels in the name.
Detailed Explanation
1. Accepting User's Name:
o The input() function is used to get the user's name. This function returns a string.
o The input is stored in the variable name.