Mushrooms¶
A mushroom file contains information on mushrooms: each line has the
vulgar name of the mushroom, the word SCIENTIFIC, the scientific
name and the word EDIBLE if the mushroom is edible or the word
TOXIC, if it is not. For example:
Cogomella SCIENTIFIC Macrolepiota Procera EDIBLE
Bolet de greix de la tardor SCIENTIFIC Gyromitra Infula EDIBLE
Bolet de pi SCIENTIFIC Hypholoma Fasciculare TOXIC
Bolet de Tinta SCIENTIFIC Coprinus Comatus EDIBLE
Farinera Borda SCIENTIFIC Amanita phalloides TOXIC
Girgola d'olivera SCIENTIFIC Omphalotus olearius TOXIC
Pebràs SCIENTIFIC Russula Delica EDIBLE
From a mushroom file we want to obtain a toxic mushroom file with only those mushrooms that are not edible. Each line will contain the vulgar name of the toxic mushroom. For example, given the file above, the corresponding file of toxic mushrooms will have the following content:
Bolet de pi
Farinera Borda
Girgola d'olivera
Write the function mushrooms_toxic() that takes the name of a
mushroom file and the name of a toxic mushroom file (strings), and
fills this second file with the vulgar names of toxic mushrooms as
described above. The order in which the toxic mushrooms appear must be
the same in both files. Save this function into file mushrooms.py
Example of mushrooms file: mushrooms.txt
Tests: tests-mushrooms.txt
Solution: mushrooms.py