hi,
I am currently taking a pyton programming class and having some extreme difficulties. I am in quite the pickle with these 3 prompts. I do not know where to start for any of these prompts; if anyone has any code or solutions to any of these three promps I will be very grateful.

Prompt 1:
Write a program that creates a dictionary of son-father pairs, you can use celebrities, fictional characters, or even historical figures for fun. Your program should present the user a menu with three options. The following is an example.

0 - Quit
1 - Find a Father
2 - Find a Grandfather

Option 0 should end the program.

Option 1 should prompt the user for the name of a son. If the dictionary contains the son-father pair, the program should display the father. Otherwise, the program should tell the user it doesn't know who the father is.

Option 2 should prompt the user for the name of a grandson. If the dictionary contains enough information, the program should display the grandson's grandfather. Otherwise, the program should tell the user it doesn't know who the grandfather is.

The dictionary you create should include several geneartions so that a grandfather can be found given the name of a grandson.

Prompt 2:

Write a program to sort a list of numbers using the insertion sort algorithm (one of the many sorting algorithms). Given a list, insertion sort works by taking elements from the list one by one and inserting them in their correct position into a new sorted list. Here is the list of numbers you are going to use in your program, nlist = [345, 100, 50, 400, 900, 1000, 45, 295]. Your program needs to sort the numbers from the smallest to the largest. Then display the numbers, in order.

Promt 3:

Write a program to solve the following two tasks. (1) Turn a list into a dictionary. Here is the list of words, wlist = [“beetle”, “beef”, “apple”, “air”, “cat”, “dog”, “bicycle”, “dig”, “feet”, “five”, “kite”, “goat”, “high”, “warm”, “wolf”, “hot”, “xylophone”, “yuk”, “yum”, “zoo”]. The dictionary your program creates should have all the words as the values and their first letters as the keys (such that “a”-[“air”, “apple”] will be one of the key-value pairs of the dictionary). (2) Then, your program should look up a particular word “cat” in the dictionary, and report if the word is in the dictionary.

See my signature for ideas.

commented: clever response ;-) +4
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.