Views
解答例9
問題1
#!/usr/bin/env python # -*- coding: utf-8 -*- sum = 0 x = input('? ') while x > 0: sum = sum + x x = input('? ') print sum
問題2
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import time t = int(sys.argv[1]) for i in range(1, t+1): print i time.sleep(1) print '*** BANG ***'
問題3
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import time t = int(sys.argv[1]) for i in range(t, 0, -1): print i time.sleep(1) print chr(7)*3