Python循环的使用(2)

#!/usr/bin/python
#coding=gb2312 

while True:
    raply=raw_input('Enter type:');
    if raply == 'stop':
        print('bye');
        break;
    elif not raply.isdigit():
        if (raply.isalpha()):
            print(raply.upper());
    else:
        num=int(raply);
        print(num **2);

 

posted @ 2013-03-04 15:49  墨迹哥's  阅读(138)  评论(0编辑  收藏  举报