Write a function sum_name_length that consumes no parameters and produces no value.
The function will repeatedly ask the user to enter names until the empty string is entered.
The function then displays the sum of the lengths of all names entered. This is illustrated in
the example below (where the user’s input is indicated in bold):
Enter a name: Chester
Enter a name: Pixel
Enter a name: Laptop
Enter a name: Whiskers
Enter a name:
The sum of all name lengths is 26
You may assume that a name does not contain any space characters.
谢谢了~
慕沐林林
catspeake
HUH函数
随时随地看视频慕课网APP
相关分类