1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Carpet inside of a grid in python [closed]

Discussão em 'Python' iniciado por Stack, Setembro 15, 2024.

  1. Stack

    Stack Membro Participativo

    given function carpet(r, c, r1, c1, i, j) where

    r = row
    c = columns
    r1 = carpet height
    c1 = carpet length
    i = displacement of carpet from the top
    j = displacement of carpet from the left


    The function must return a tuple of strings representing an r×c. This tuple must consist of exactly r (str), each of which represents a row and consists of exactly c characters. Each character is either a dot (.) representing a floor tile not covered with carpet, or (#) representing a floor tile covered with carpet.

    Example: carpet(6, 9, 3, 4, 1, 2)
    Example Return Value:
    (
    ".........",
    "..####...",
    "..####...",
    "..####...",
    ".........",
    ".........",
    )


    Not allowed: Advanced python concepts, this problem is more on foundational concepts.

    • No Direct recursion
    • No assignment statements
    • No list
    • No range
    • No maps
    • No loops

    Continue reading...

Compartilhe esta Página