Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Program Write a program that reads from a file named Names.txt the names of people in the form of X ben Y or X

Python Program

Write a program that reads from a file named "Names.txt" the names of people in the form of "X ben Y" or "X bent Y". In other words, we're talking about X being the son or the daughter of Y. The file will contain a number of such entries. Your job is to analyze them and come up with a list that starts with the Grand-grand father followed by his sons and daughters and then his grand-sons and/or grand-daughters. For example, if the "Names.txt" file contained the following entries: A ben B B ben C D ben A E ben A F ben E

then your program should output the following file named "Tree.txt": C B A D, E F

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions

Question

How might interviewers interpret your body language?

Answered: 1 week ago

Question

Prepare a constructive performance appraisal.

Answered: 1 week ago

Question

List the advantages of correct report formatting.

Answered: 1 week ago