title: Write a program that prompts the user for first and last names. The program then prints last name and first
body: <p>Write a program that prompts the user for first and last names. The program then prints last name and first. If user only enter one name, then give an error message. Please help for my if statement. Many Thanks</p>
  
  <pre><code>name = str(input("Your first and last names? "))
  gap = name.find(" ")
  name_length = len(name)
  first = name[0:gap]
  last = name[gap + 1 : name_length]
  if name_length is 2:
      print("Name: ", last.upper(), ", ", first.capitalize(), sep = "")
  
  else:
      print("ERROR: only one name found")
  </code></pre>
  
  <p>And these are what I except:</p>
  
  <p>anGUS snodgrass</p>
  
  <p>Your first and last names? Name: SNODGRASS, Angus</p>
  
  <p>angus</p>
  
  <p>Your first and last names? ERROR: only one name found</p>