From 1e293e5904a24ec34cdf7403305d2d1274c048f8 Mon Sep 17 00:00:00 2001 From: Armen Vartan Date: Tue, 2 Dec 2014 14:57:10 -0500 Subject: [PATCH] triangles yo --- python/5-triangles-part-1/README.md | 34 +++++++++++++-------------- python/5-triangles-part-1/triangle.py | 1 + 2 files changed, 17 insertions(+), 18 deletions(-) create mode 100644 python/5-triangles-part-1/triangle.py diff --git a/python/5-triangles-part-1/README.md b/python/5-triangles-part-1/README.md index e276820..54a9a04 100644 --- a/python/5-triangles-part-1/README.md +++ b/python/5-triangles-part-1/README.md @@ -1,19 +1,17 @@ -####Print a Triangle - -##Using nested for loops, print a triangle like so: - -`*` -`**` -`***` -`****` -`*****` -`******` -`*******` -`********` -`*********` -`**********` - -This triangle is 10 high, but I want the ability to make it as high as I want by setting one variable. - -You can print this to the console or to the printout div. +Print a Triangle +================ +Using nested for loops, print a triangle like so: +``` +>>> triangle(10) +* +** +*** +**** +***** +****** +******* +******** +********* +********** +``` diff --git a/python/5-triangles-part-1/triangle.py b/python/5-triangles-part-1/triangle.py new file mode 100644 index 0000000..43c16ce --- /dev/null +++ b/python/5-triangles-part-1/triangle.py @@ -0,0 +1 @@ +def triangle(num):