Rabu, 04 Mei 2011

Sample Looping Programs for Python 1

Just sharing the code for all,
You can copy an existing program code below

a = raw_input("insert the word: ")
b = input("Want to repeat how many times?")
c = 1
while 1<=b:
    while c<=b-1:
        print a*c
        c=c+1
    print a*b
    b=b-1

and the result will be as follows

Tidak ada komentar:

Posting Komentar