Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- count = 0;
- name = [];
- sortValue = "Unsorted"
- def seperator ():
- print("=" * 40)
- def output(sortValue, numItems):
- print()
- seperator()
- print()
- print(format(sortValue) + " List of Names")
- print()
- seperator()
- for count in range(0, numItems, 1):
- print("Name " + format("[" + format(count + 1, "2d") + " ]: --> ", ">10s") + name[count])
- seperator()
- def sort():
- name.sort()
- global sortValue
- sortValue = "Sorted"
- def main():
- numItems = int(input("How many names do you wish to enter? "))
- for count in range(0, numItems, 1):
- name.append(str(input("Enter the name of the customer <Last name, First name> " + \
- format("[" + format(count + 1, "2d") + " ]: ", ">4s"))))
- output(sortValue, numItems)
- sort()
- output(sortValue, numItems)
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement