摘要: package run1;import java.util.ArrayList;import java.util.Arrays;import java.util.Iterator;import java.util.List;/** * 被选课程类 * @author Administrator * ... 阅读全文
posted @ 2016-01-12 15:09 run26120011 阅读(145) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: cp936 -*-#创建列表list = ['a', 1, ('a', 'b')]print list#Python 列表操作list = ['a', 'b', 0, 1, 3]#得到列表中某个值start = list[0]end = list[-1]print sta... 阅读全文
posted @ 2015-11-10 11:56 run26120011 阅读(222) 评论(0) 推荐(0) 编辑
摘要: split 和 join一、关于split 和 join 方法1只针对字符串进行处理。split:拆分字符串、join连接字符串2.string.join(sep): 以string作为分割符,将sep中所有的元素(字符串表示)合并成一个新的字符串3.string.split(str=' ',nu... 阅读全文
posted @ 2015-11-09 14:00 run26120011 阅读(449) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: cp936 -*-from sys import argvfrom os.path import existsscript, from_file, to_file = argvprint "Copying from %s to %s" % (from_file, to_f... 阅读全文
posted @ 2015-11-02 16:07 run26120011 阅读(123) 评论(0) 推荐(0) 编辑
摘要: for循环for..in是另外一个循环语句,它在一序列的对象上递归即逐一使用队列中的每个项目。我们会在后面的章节中更加详细地学习序列。使用for语句例6.3 使用for语句#!/usr/bin/python# Filename: for.pyforiinrange(1,5):printielse:p... 阅读全文
posted @ 2015-11-02 14:57 run26120011 阅读(162) 评论(0) 推荐(0) 编辑