import name_functions as nf print("Enter 'q' at any time to quit.") while True: first = input("\n Please give me a first name: ") if first is 'q': break last = input("\n Please give me a last name: ") if last is 'q': break fullname = nf.get_formatted_name(first, last) print(f"\n Your name formatted: {fullname}")
from name_functions import get_formatted_name print("Enter 'q' at any time to quit.") while True: first = input("\nPlease give me a first name: ") if first == 'q': break last = input("Please give me a last name: ") if last == 'q': break formatted_name = get_formatted_name(first, last) print("\tNeatly formatted name: " + formatted_name + '.')
def test_first_last_middle_name(self): """Do names like 'Wolfgang Amadeus Mozart' work? """ formatted_name = get_formatted_name('wolfgang', 'mozart', 'amadeus') self.assertEqual(formatted_name, 'Wolfgang Amadeus Mozart')
def test_first_last_name(self): """Do names like 'Janis Joplin' work?""" formatted_name = get_formatted_name('janis', 'joplin') self.assertEqual(formatted_name, 'Janis Joplin')
def test_first_last_name(self): formatted_name = get_formatted_name('faiz', 'khan') self.assertEqual(formatted_name, 'faiz khan')
def test_first_last_middle_name(self): formatted_name = get_formatted_name('faiz', 'khan', 'Muhammad') self.assertEqual(formatted_name, 'faiz Muhammad khan')