1.for(int i : index){}用法[又称是foreach用法]: 比如: public class Test { public static void main(String[] args) { //输出结果 int[] fdx = new int[]{1,8,3,7,9,2,4}; int[] index = new int[]{0,1,2,0,3,1,4,2,2,5,6}; String tel = ""; for(int i :index){ tel +=fdx[i…
1.while 循环语句 #!/usr/bin/env python # -*- coding:utf-8 -*- import time bol = True while bol: print '1' time.sleep(1) bol = False print 'hello,world!' 2.无限的输出数字 #!/usr/bin/env python # -*- coding:utf-8 -*- import time n = 0 while True: n = n + 1 time.s…