python练习题(二)

wKioL1W4wHHCRIFNAACAJirpQms827.jpg


#!/usr/bin/env python


num=raw_input('Please input a number: ')


if num.isdigit() is True:

    for i in range(int(num)):

        print (int(num) - int(i)) * ' ' + (int(num) - int(i)) * '*'

else:

    print 'Input Error !'


你可能感兴趣的:(python,error,number,练习题)