摘要: // 1 Array数组 // 创建数组 // (1)使用 Array构造函数 // new Array() 小括号里 可写预知的存储数量, 或者直接存值 // 创建一个保存元素的数组 var colors = new Array(3); colors[0] = "purple"; colors[1 阅读全文
posted @ 2017-12-29 16:41 poetL 阅读(92) 评论(0) 推荐(0) 编辑
摘要: // 函数的定义 /*function functionName([arg0,arg1.....argn]){ statements } 1 functionName 是需要定义的函数名,属于标识符 2 [] 中的arg0,arg1..... 为函数参数 3 [] 说明里面的内容不是必须的,他不是语法 */ // 声明一个函数 // funct... 阅读全文
posted @ 2017-12-29 16:40 poetL 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2017-12-29 14:33 poetL 阅读(97) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html><head> <title>Document</title></head><body> <script type="text/javascript"> // // 声明变量 // var name_01; // name_01 = "marry"; // v 阅读全文
posted @ 2017-12-29 14:32 poetL 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 为了避免打开文件后忘记关闭,可以通过管理上下文 with 执行完毕之后 自动关闭且释放资源 阅读全文
posted @ 2017-12-27 18:42 poetL 阅读(529) 评论(0) 推荐(0) 编辑
摘要: eval 功能:将字符串str当成有效的表达式来求值并返回计算结果。 语法: eval(source[, globals[, locals]]) -> value 参数: source:一个Python表达式或函数compile()返回的代码对象 globals:可选。必须是dictionary l 阅读全文
posted @ 2017-12-27 18:32 poetL 阅读(455) 评论(0) 推荐(0) 编辑
摘要: flush()使用 !/usr/bin/python coding: UTF 8 打开文件 fo = open("runoob.txt", "wb") print("文件名为: ", fo.name) 刷新缓冲区 fo.flush() 关闭文件 fo.close() 阅读全文
posted @ 2017-12-27 18:17 poetL 阅读(666) 评论(0) 推荐(0) 编辑
摘要: 1 # -*- coding:utf-8 -*- 2 # __author__ : poetl 3 # date: 2017/12/27 4 5 # 字典特点: 无序, 键唯一 6 7 8 zone ={ 9 '山东' : { 10 '青岛' : ['四方','黄岛','崂山','李沧','城阳'], 11 '济南' : ['... 阅读全文
posted @ 2017-12-27 11:54 poetL 阅读(119) 评论(0) 推荐(0) 编辑
摘要: # -*- coding:utf-8 -*- # __author__ : poetl # date: 2017/12/26 salary = int(input("Please input your salary:")) balance = salary shop_list = [5800, 1500, 9000, 32, 80] shop_name = ["iphone6s", "bicyl... 阅读全文
posted @ 2017-12-27 00:04 poetL 阅读(343) 评论(0) 推荐(0) 编辑
摘要: for i in range(1, 10): for j in range(1, i + 1): print("%d*%d=%2d" % (i, j, i * j), end=' ') print(" ") for i in range(1, 10): for j in range(1, i + 1 阅读全文
posted @ 2017-12-27 00:03 poetL 阅读(96) 评论(0) 推荐(0) 编辑