Computer Science, asked by anindyaadhikari13, 4 months ago

Design Python c∅de for the pattern. ​

Attachments:

Answers

Answered by atrs7391
7

"""

Project Type: Brainly Answer

Date Created: 13-02-2021

Date Edited Last Time: ---NIL---

Question Link: https://brainly.in/question/35111604

Question: Design Python c0de for the pattern.

 * *   * *

*     *     *

*           *

 *       *

   *   *

     *

Program Created By: atrs7391

Programming Language: Python

Language version (When program created or last edited): Python 3.9.1

"""

for i in range(6):

   for j in range(7):

       if (i == 0 and j % 3 != 0) or (i == 1 and j % 3 == 0) or (i-j == 2) or (i+j == 8):

           print("*", end=" ")

       else:

           print(end="  ")

   print()

Attachments:
Answered by diajain01
90

{\boxed{\underline{\tt{ \pink{Required  \:  \: Answer:-}}}}}

 \orange{for} \: row \:  \orange{in} \:  \purple{range} \: (6) :

 \:  \:  \:  \:  \:  \:  \:  \orange{for} \: col \: in \:  \purple{range} \: (7):

\:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \orange{if} \: (row =  =  0 \:  \orange{and} \: col \:  modulus \: 3! = 0) \orange{or} \: (row \:  =  = 1 \:  \orange{and} \: col \: modulus \: 3 =  = 0) \orange{or} \: (row - \: col \:  =  = 2) \orange{or}  \: (row \:  + col \:  =  = 8):

\:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \purple{print} \: ( \green{" ✷" }) \: end \:  =  \green{" " })

\:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \:  \purple{print}( \green{"  \:  \: "}  \:  ,end \:  =  \green{" "} )

 \purple{print} \: ()

HOPE IT HELPS :)

Attachments:
Similar questions