how should change?
While True:
Print (" \ nPlease tell me your name: ") # \ n makes both Please tell me your name:
is a line in the front of the SpacesF_name=input (" First name: ")
Print (" if there is no Middle name, please input q ")
M_name=input (" Middle name: ")
If m_name=='q:
L_name=input (" Last name: ")
Formatted_name=get_formatted_name (f_name l_name)
Print (" \ nHello, "+ formatted_name +"!" )
Break
The else:
L_name=input (" Last name: ")
Formatted_name=get_formatted_name (f_name m_name, l_name)
Print (" \ nHello, "+ formatted_name +"!" )
break
CodePudding user response:
While True:
The first_name=input (" please enter your first name: ")
Middle_name=input (" please enter your middle name: ")
Last_name=input (" please enter your last name: ")
If middle_name:
Print (" hello "+ first_name, middle_name + last_name)
The else:
Print (" hello "+ +" q "first_name + last_name)
CodePudding user response:
Output order problem, should see you get_formatted_name function of internal operations
While True:
Print (" \ nPlease tell me your name: ") # \ n makes both Please tell me your name:
is a line in the front of the SpacesF_name=input (" First name: ")
Print (" if there is no Middle name, please enter the enter ")
M_name=input (" Middle name: ")
If len (m_name)==0:
L_name=input (" Last name: ")
Formatted_name=f_name + l_name
Print (" \ nHello, "+ formatted_name +"!" )
Break
The else:
L_name=input (" Last name: ")
Formatted_name=f_name + m_name + l_name
Print (" \ nHello, "+ formatted_name +"!" )
Break