Answer to Question #250018 in Python for phil

Question #250018

Write a program that allows the user to input his/her full name (assuming that the last

word will be the surname). The program should then respond by telling the user the

following:

i) The number of names that he/she has.

ii) The user’s firstname.

iii) The user’s surname.

iv) The full name without the spaces.

v) The number of characters in the name.

vi) The number of unique characters in the name.


1
Expert's answer
2021-10-11T16:08:30-0400
name = input("Enter your full name: ")
names = name.split()
print("Your first name is", names[0])
print("Your surname is", names[-1])
full_name = ''.join(names)
print("Your full name w/o spaces is:", full_name)
print("It has", len(full_name), "characters")
chars = set(full_name.lower())
print("It has", len(chars), "unique characters")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS