Python Basics

Seymore4Head Seymore4Head at Hotmail.invalid
Fri Oct 3 18:54:13 EDT 2014


On Fri, 3 Oct 2014 10:35:38 -0700 (PDT), diarmuid.higgins at mycit.ie
wrote:

>Hi
>
>I have just started an introductory course on Python. I have never even seen a programming language before so I am struggling a bit. Our lecturer has given us a number of excercises to complete and I am stuck on the one I have listed below. Please help 
>
>Q2. Implement a function called printNumTriangle. The function should ask the user to enter a single integer. It should then print a triangle of that size specified by the integer so that each row in the triangle is made up of the integer displayed. 
>
>The following is a sample output
>
>Please enter an integer for triangle size:
>1
>22
>333
>4444
>55555
for i in range(1,10):
    print (str(i)*i)



More information about the Python-list mailing list