Skip to content

jonhandy/itp-w1-create-box

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[itp-w1] Create Box

Write a program that takes three inputs: height, width, and character. Use your knowledge of loops to create a box made of characters based on the inputs.

Note: You need to return your box, not just print it.

>>> create_box(3, 4, '*')
'****
 ****
 ****'
>>> create_box(2, 2, '@')
'@@
 @@'

Ideas for enhancements in case of extra time:

  • Add error checking to make sure the width and height is greater or equal to 1
  • Add an extra unit test for the third case in the tests file
  • For an extra challenge, make it so only the outer border of the box shows and it is not filled in. Make this a separate function and add unit tests for it.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 86.4%
  • Makefile 13.6%