摘要: print('*'*50) list1 = list(range(1,6)) print(list1) del(list1) #range(1,20) 按顺序生成列表 list1 = [] for x in range(1,6): list1.append(x*x*x) print(list1) d 阅读全文
posted @ 2019-09-27 11:04 Renqy 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 1、本程序是测试函数的基础、函数的参数、递归函数的测试。函数的参数有:必选参数、默认参数、可变参数、命名关键字参数和关键字参数#!/usr/bin/python # -*- coding: utf-8 -*- #当程序存在中文时,注释表明使用utf-8编码解释 #函数学习 print('函数定义') 阅读全文
posted @ 2019-09-26 15:56 Renqy 阅读(349) 评论(0) 推荐(0) 编辑
摘要: 程序用来计算ax^2+bx+c=0的两个根,有些异常暂时无法处理;#!/usr/bin/python# -*- coding: utf-8 -*- #当程序存在中文时,注释表明使用utf-8编码解释#计算函数ax^2+bx+c=0的两个解,自定义方法import mathwhile True: print('本程序用来计算ax^2+bx+c=0的两个根') print('使用请输... 阅读全文
posted @ 2019-09-25 14:35 Renqy 阅读(8867) 评论(0) 推荐(0) 编辑
摘要: Python的循环有两种:一种是for…in 循环:主要用于遍历tuple、list;一种是while循环:只要条件满足,就不断循环,条件不满足时退出循环。#!/usr/bin/python# -*- coding: utf-8 -*- #当程序存在中文时,注释表明使用utf-8编码解释 #for...in循环,依次把list或tuple中的每个元素迭代出来list = ['lingy... 阅读全文
posted @ 2019-09-25 13:18 Renqy 阅读(3606) 评论(0) 推荐(0) 编辑
摘要: 可以将字典看作是特殊的列表,将下标0、1、2,表示成name,age,job。程序列出了基本的增删改查,其余方法自行测试。1、程序测试#!/usr/bin/python # -*- coding: utf-8 -*- #当程序存在中文时,注释表明使用utf-8编码解释 a = 'name' dic 阅读全文
posted @ 2019-09-25 11:01 Renqy 阅读(781) 评论(0) 推荐(0) 编辑
摘要: 列表的方法有很多,下面程序只测试了部分。1、基本方法测试#!/usr/bin/python # -*- coding: utf-8 -*- #当程序存在中文时,注释表明使用utf-8编码解释 print('下面是单字符串序列练习') a = 'lingyunmu' #这是一个字符串,也是一个序列,一 阅读全文
posted @ 2019-09-25 10:36 Renqy 阅读(485) 评论(0) 推荐(0) 编辑
摘要: Python运算符有(算数运算符、比较运算符、赋值运算符、逻辑运算符、位运算符、成员运算符、身份运算符);本程序包含算数、比较、赋值、逻辑、成员运算符。1、运算符测试#!/usr/bin/python # -*- coding: utf-8 -*- #当程序存在中文时,注释表明使用utf-8编码解释 阅读全文
posted @ 2019-09-24 10:57 Renqy 阅读(645) 评论(0) 推荐(0) 编辑
摘要: In the story I was the first person perspective --That was in 2015 September 19 PM 4 what happened 40 minutes or so. I walked with an umbrella, umbrella walked with the rain, a person walking in the s... 阅读全文
posted @ 2019-09-23 13:02 Renqy 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 一、导出配置用户名密码,使能ftpftp server enable aaalocal-user putty password cipher putty123local-user putty privilege level 3local-user putty ftp-directory flash:/local-user putty service-type ftp配置vlan地址-ftp地址in... 阅读全文
posted @ 2019-09-23 12:36 Renqy 阅读(8066) 评论(0) 推荐(0) 编辑
摘要: PS: goto还是很好玩的。 #include #include typedef struct _node{ int value; struct _node *next;} Node;typedef struct _list{ Node* head;}List;void add(List* plist,int number);void print(List* list);voi... 阅读全文
posted @ 2019-09-23 12:26 Renqy 阅读(1434) 评论(2) 推荐(0) 编辑