![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
你有我备注吗
这个作者很懒,什么都没留下…
展开
-
python学习之运算符
1、算数运算符2、比较运算3、赋值运算4、逻辑运算5、成员运算原创 2019-04-26 22:42:13 · 90 阅读 · 0 评论 -
python学习之条件语句、循环语句、break、continue
1、条件语句if…else…示例mood = "bad"if mood == "great": print("today is a woderful day")else: print("So terrible!!!")输出:So terrible!!!if … elif… else…示例color = "green"if color == "green": print("...原创 2019-04-26 23:59:25 · 208 阅读 · 0 评论 -
python学习之字符串方法(一)
字符串方法测试# 测试用例a = 'i am Chinese,I like Chinese!'aa = 'it contains tab!'print(len(a))# 首字母大写,其它全部小写b = a.capitalize()print(a)# 字符串方法返回新字符串,不改变原字符串print(b)# 居中显示,第一个参数width,第二个参数fillcha...原创 2019-04-30 20:38:29 · 130 阅读 · 0 评论 -
Python学习之推导式
列表和字典都有推导式,元组没有推导式。列表的推导式:[expression for item in iterable if condition]下面这个例子的方法写得很棒,记录一下除了列表,字典也有自己的推导式。最简单的例子就像:{ key_expression : value_expression for expression in iterable }类似于列表推导,字典推导也有if...原创 2019-05-06 20:25:06 · 201 阅读 · 0 评论 -
7. Reverse Integer(python3实现)
Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note:Assume we are dealing with an ...原创 2019-06-02 16:54:29 · 323 阅读 · 0 评论 -
1. Two Sum(python3实现)
问题描述:Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the ...原创 2019-06-02 15:51:25 · 734 阅读 · 0 评论