Text: Python
Includes if __name__ == '__main__': is possible
Problem 1 - british_succession.py
In the British line of succession, when a new child is born, he or she (gender no longer matters) is placed behind their parents or youngest sibling (if they exist). Use the following list in your code so that the autograder is sure to accept your answer:
royal_succession = ['Charles', 'William', 'George', 'Charlotte', 'Louis', 'Harry', 'Archie', 'Lilibet']
Then, write code that does the following:
1. Inserts a new member of the royal family behind Louis or Lilibet based upon if William or Harry have another child, then print the new royal line.
2. Get the current position of a royal family member based upon the new insertion.
Please enter the name of the new royal: Alice
Is the child's older sibling Louis or Lilibet? Louis
['Charles', 'William', 'George', 'Charlotte', 'Louis', 'Alice', 'Harry', 'Archie', 'Lilibet']
What royal would you like to get the current position for? Charlotte
They are number 3 in line
Please enter the name of the new royal: Albert
Is the child's older sibling Louis or Lilibet? Lilibet
['Charles', 'William', 'George', 'Charlotte', 'Louis', 'Harry', 'Archie', 'Lilibet', 'Albert']
What royal would you like to get the current position for? Harry
They are number 5 in line
HINT: To insert an item into a list, use the code list_name.insert(index, item), where index is the index number.