14 lines
369 B
Python
14 lines
369 B
Python
def getName():
|
|
while True:
|
|
name = input('Jeg heter: ')
|
|
if (' ' in name):
|
|
return name.split(' ')
|
|
print('Putt et mellomrom mellom fornavn og etternavn')
|
|
|
|
capitalize = lambda name: name.capitalize()
|
|
|
|
names = list(map(capitalize, getName()))
|
|
firstNames = ' '.join(names[:-1])
|
|
lastName=names[-1]
|
|
|
|
print(f'The name is {lastName}, {firstNames} {lastName}') |