Draw a beautiful T X30822


Statement
 

pdf   zip

You have to program the function below.

  • Write a function @drawT(width, height)@ that given integers numbers ๐‘ค๐‘–๐‘‘๐‘กโ„Ž\textit{width} and โ„Ž๐‘’๐‘–๐‘”โ„Ž๐‘ก\textit{height} such that ๐‘ค๐‘–๐‘‘๐‘กโ„Ž\textit{width} is odd and 1โ‰ค๐‘ค๐‘–๐‘‘๐‘กโ„Ž,โ„Ž๐‘’๐‘–๐‘”โ„Ž๐‘กโ‰ค91 \le \textit{width}, \textit{height} \le 9 draws a beautiful TT of he appropriate size. Follow the patterns below.

Scoring

The function counts 100 points.

Sample session

Sample session
>>> drawT(5, 7)
55555
  7
  7
  7
  7
  7
  7
>>> drawT(7, 6)
7777777
   6
   6
   6
   6
   6
>>> drawT(9, 1)
999999999
>>> drawT(1, 4)
1
4
4
4
>>>
Information
Author
ProAl
Language
English
Official solutions
Python
User solutions
Python