animal_farm.py
"""Our own little animal farm."""
import sys
def add_animal(farm, animal):
farm.add(animal)
return farm
def main(animals):
farm = set()
for animal in animals:
farm = add_animal(farm, animal)
print("We've got some animals on the farm:", ','.join(farm) + '.')
if __name__ == '__main__':
if len(sys.argv)==1:
print('Pass at least one animal type!')
sys.exit(1)
main(sys.argv[1:])
Disclaimer: The above articles are added by users themselves and are only for typing and communication purposes. They do not represent the views of this website, and this website does not assume any legal responsibility. This statement is hereby made! If there is any infringement of your rights, please contact us promptly to delete it.