Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1. count = 0;
  2. name = [];
  3. sortValue = "Unsorted"
  4. def seperator ():
  5.   print("=" * 40)
  6.  
  7. def output(sortValue, numItems):
  8.   print()
  9.   seperator()
  10.   print()
  11.   print(format(sortValue) + " List of Names")
  12.   print()
  13.   seperator()
  14.   for count in range(0, numItems, 1):
  15.     print("Name " + format("[" + format(count + 1, "2d") + " ]: --> ", ">10s") + name[count])
  16.     seperator()
  17.  
  18. def sort():
  19.     name.sort()
  20.     global sortValue
  21.     sortValue = "Sorted"
  22.  
  23. def main():
  24.   numItems = int(input("How many names do you wish to enter? "))
  25.  
  26.   for count in range(0, numItems, 1):
  27.     name.append(str(input("Enter the name of the customer <Last name, First name> " + \
  28.     format("[" + format(count + 1, "2d") + " ]: ", ">4s"))))
  29.  
  30.   output(sortValue, numItems)
  31.   sort()
  32.   output(sortValue, numItems)
  33.  
  34. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement