Code Monkey home page Code Monkey logo

python-test-task's Introduction

Japanese flag

The purpose of the task is to implement a function that will accept a single input parameter N and output a string with an ASCII art of the japanese flag.

Here is an example of flags for various values of N:

N = 2                           N = 6
########                        ####################
#      #                        #                  #
#  **  #                        #                  #
#  **  #                        #                  #
#      #                        #        **        #
########                        #       *oo*       #
                                #      *oooo*      #
N = 4                           #      *oooo*      #
##############                  #       *oo*       #
#            #                  #        **        #
#            #                  #                  #
#     **     #                  #                  #
#    *oo*    #                  #                  #
#    *oo*    #                  ####################
#     **     #
#            #
#            #
##############

The following is a list of requirements for the function:

  • The input N shall be an integer even number
  • The width of the inner area of the rectangle (excluding border) shall be 3 * N
  • The height of the inner area of the rectangle (excluding border) shall be 2 * N
  • The vertical distance between the circle and the border of the rectangle shall be N/2
  • The horizontal distance between the circle and the border of the rectangle shall be N
  • # symbol shall be used for rectangle border, * symbol shall be used for the circle border, o symbol shall be used for inner circle area
  • The function shall return a string and use \n as line separators
  • The function shall accept a single parameter N
  • If the parameter is not a valid even integer number the ArgumentError exception shall be thrown
  • The result of the task shall be provided a single python file named flag.py with a function named flag defined in it

python-test-task's People

Contributors

paul-vasiliev avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.