Write 3 functions squareQuads(n), squareDiagonals(n) and squareTriangle(n). Each function is based on the ‘hollow’ square we discussed. The modifications are small but require analysis of the request to complete successfully. As we did in class, use the print(‘*’, end=’’) statement to display the variations. All are based on at least a 5 x 5 square, and the dimensions must be an odd number. In the examples below I used a 9 x 9 square (n = 9) a. squareQuads(n) should display a n x n square with 4 quadrants. b. squareDiagonals(n) should display a n x n square with diagonals from opposite corners. c. squareTriange(n) should display a n x n square with an inner triangle. The size of the triangle should vary with the size of the square. It is important that the sides of the triangle, never touch the sides of the square, i.e. there should be a one * width around the right angle sides of the triangle and a one * width from all top/right side of the square for the top of the hypotenuse and a one * width from the bottom/left side of the square for end of the hypotenuse.
vendredi 21 octobre 2016
Create a square in python 3.5
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire