Posts: 4,647
Threads: 1,494
Joined: Sep 2016
i would not ask for the language. i would just figure it out based on the name of animal they enter. just don't try to do this with Danish, Norwegian, and Swedish.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 1,298
Threads: 38
Joined: Sep 2016
(Apr-02-2017, 05:00 AM)Skaperen Wrote: i would not ask for the language. i would just figure it out based on the name of animal they enter. just don't try to do this with Danish, Norwegian, and Swedish.
True, and as wavic pointed out as well, there are usually alternate ways to accomplish the same goal. However, in the "Homework" section, I try and give an answer that applies to the actual problem description as supplied by the OP. My reasoning is, the instructor might be building a foundation for future exercises. In this case, it might be, the next assignment is to take this exercise and now rewrite it to use tuples, lists or dictionaries, the next may be to include some error checking and so on. Just my thought process

.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition