SpamapS / allflags

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

We need a Python program that generates all the possible flags with 3 colored stripes, see attachment. The colors can be: White, Black, Green, Red, Blue, Green and Orange.

Question 1: Please generate alle the possible flags. One color van not be the same in two stripes next to each other. So green, white, green is possible.

Question 2: Please generate alle the possible flags. One color can only be used onces in a flag. So green, white, green is not good, but So green, white, blue is possible.

Make a Python-program (for mathematic education) that makes this visable. We leave it to your creativity if it is possible to show the flags very small on the screen.

It would be very nice if you can help us!

Thanks in advance, Durk Jan de Bruin

PS: Not all the flags exist in real countries. That is no problem

Testing

You can run the test with py.test

py.test allflags.py

You can print the flags as word tuples with:

./allflags.py

If you want ansi colors in a terminal use:

pipenv run ./allflags.py

About

License:Apache License 2.0


Languages

Language:Python 100.0%