- 博客(11)
- 资源 (1)
- 收藏
- 关注
原创 python set的应用
You are given two sorted arrays that contain only integers. Your task is to find a way to merge them into a single one, sorted inascending order. Complete the function mergeArrays(arr1, arr2), where ...
2018-07-24 10:13:41 713
原创 python 类的初识
Python作为高级语言,也是一门面向对象的语言。面向对象实现的基础就是类(Class)。今天来看一下python中类是如何创建的。如果有接触过面向对象,例如Java,那么对以下概念的理解应该不是很难。关于类的简介类(Class): 用来描述具有相同的属性和方法的对象的集合。它定义了该集合中每个对象所共有的属性和方法。它是一种抽象的概念。 类变量:类变量在整个实例化的对象中是公用的...
2018-07-19 14:20:39 303
原创 python hello world
学习大多数的编程语言时,基本上都绕不开 hello world那么python的hello world呢,刚刚在codewars上看到了几个。切片def greet(): return 'dlrow olleh'[::-1]def greet(): return 'The most beautiful hello world'[19:] 编码greet...
2018-07-17 18:10:09 1132
原创 python 格式化字符串 str.format()
Task:Given a number, 3 for example, return a string with a murmur: "1 sheep...2 sheep...3 sheep..."Note:You will always receive a positive integer.可以直接用for和字符串拼接 ,不过需要先将range(1,n+1)字符串化,否则st...
2018-07-17 15:14:37 591
原创 Python 字符替换
python中对字符串中的字符进行替换,首先想到的是str.replace()这对单个及少量字符的替换是比较方便的。例如,将所有的‘5’,‘0’,‘1’全部替换为‘S’,'O','I':>>> x= "W0W! 1'm 5o good!">>> x.replace('0','O').replace('1','I').replace('5...
2018-07-17 11:36:05 2114 2
原创 python 数字判断
Given a string s, write a method (function) that will return true if its a valid single integer or floating number or false if its not.Valid examples, should return true:isDigit("3")isDigit(" 3...
2018-07-16 23:16:49 4880
原创 Python join()
一下是*/Python27/Lib/string.py中关于join的定义 join() 方法用于将序列中的元素以指定的字符连接生成一个新的字符串。def join(words, sep = ' '): #默认seq为一个空格 """join(list [,sep]) -> string #返回值为string Return a string composed of the...
2018-07-15 23:16:00 2376
原创 re 高级字符串处理工具
Description: Replace all vowel to exclamation mark in the sentence. aeiouAEIOU is vowel.Examples replace("Hi!") === "H!!" replace("!Hi! Hi!") === "!H!! H!!" replace("aeiou") === "!!!!!"
2018-07-15 19:04:44 384 1
原创 vim 异常退出 swp文件提示
刚开始使用vim编辑文档时,由于对模式及命令的不熟悉,经常会进入一些搞不清状况的情形,然后强制退出文档,最开始的时候甚至会使用Ctrl+Z来强制关闭vim。 诸如此类的非正常关闭vim编辑器(直接关闭终端、电脑断电等),都会生成一个用于备份缓冲区内容的临时文件——.swp文件。它记录了用户在非正常关闭vim编辑器之前未能及时保存的修改,用于文件恢复。并且多次意外退出并不会覆盖旧的.s...
2018-07-04 16:37:37 9807 45
原创 命令 date
date命令可以用来显示或设定系统的日期与时间,在显示方面,使用者可以设定欲显示的格式,格式设定为一个加号后接数个标记1. 显示时间| date --date=11:11:11date命令的参数有很多,这里就不一一列举了。看上去,自己可能会比较多用的大概就这些个%H : 小时(00..23)%M : 分钟(00..59)%S : 秒(00..61)%T : 直接显示时间 (24 小时制)%r ...
2018-06-08 23:33:00 601
原创 命令 echo
1. 输出字符串| echo deng379> deng379| echo "i'm deng379"> i'm deng379如果不带双引号,由于单引号( ' )的存在,回车后无法输出到终端,需要Ctrl+C,才能退回到命令行模式| echo i'm deng379>>>(Ctrl+C)|需要使用转义字符| echo i\'m deng379> ...
2018-06-07 23:58:02 7389 92
Digital Signal Integrity-Modeling and Simulation
2017-09-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人