python学习--string
1\string are immutable, which means you can't change an existing string.
>>>greeting = 'Hello world!'
>>>greeting[0] = 'J'
TypeError: object does not support item assignment
2\The world in is a boolean operator that takes two strings and returns True if the first appears as a substring in the second. For example, the following function prints all the letters from word1 that also appear in word2:
>>>def in_both(word1, word2):
>>> for letter in word1:
>>> if letter in word2:
>>> print letter
3\The relational operators work on strings.
All the uppercase letters come before all the lowercase letters
python学习--string的更多相关文章
- python学习第四天基本数据类型 int,string,bool
python跟其他编程语言一样,拥有基本的数据类型,计算机 只能识别0101,python是解释语言,有其他的解释器 python整型 int a=10 type(a) "int| pyth ...
- Python 学习小结
python 学习小结 python 简明教程 1.python 文件 #!/etc/bin/python #coding=utf-8 2.main()函数 if __name__ == '__mai ...
- Python学习记录day6
title: Python学习记录day6 tags: python author: Chinge Yang date: 2016-12-03 --- Python学习记录day6 @(学习)[pyt ...
- Python学习记录day5
title: Python学习记录day5 tags: python author: Chinge Yang date: 2016-11-26 --- 1.多层装饰器 多层装饰器的原理是,装饰器装饰函 ...
- python学习笔记系列----(八)python常用的标准库
终于学到了python手册的最后一部分:常用标准库.这部分内容主要就是介绍了一些基础的常用的基础库,可以大概了解下,在以后真正使用的时候也能想起来再拿出来用. 8.1 操作系统接口模块:OS OS模块 ...
- 记录Python学习中的几个小问题
记录Python学习中的几个小问题,和C#\JAVA的习惯都不太一样. 1.Django模板中比较两个值是否相等 错误的做法 <option value="{{group.id}}&q ...
- 180分钟的python学习之旅
最近在很多地方都可以看到Python的身影,尤其在人工智能等科学领域,其丰富的科学计算等方面类库无比强大.很多身边的哥们也提到Python非常的简洁方便,比如用Django搭建一个见得网站只需要半天时 ...
- python中string模块各属性以及函数的用法
任何语言都离不开字符,那就会涉及对字符的操作,尤其是脚本语言更是频繁,不管是生产环境还是面试考验都要面对字符串的操作. python的字符串操作通过2部分的方法函数基本上就可以解决所有的字符串 ...
- Python学习指南
学习python书籍&资料: 1. Python v2.7.5 documentation 2. [Python参考手册(第4版)].(美)比兹利.扫描版.pdf 3. [Python技术手册 ...
随机推荐
- 通过WMI配置IP
$wmi = gwmi win32_networkadapterconfiguration -filter "ipenabled = 'true'"$wmi.EnableStati ...
- SilkTest天龙八部系列1-初始化和构造函数
SilkTest没有提供专门的构造函数机制,但是在类对象生成的过程中,会先初始化在类中申明的变量.我们可以在初始化该变量的时, 调用某些函数完成对象初始化工作,看上去好像是调用了构造函数一样.不过要记 ...
- 《app研发录》第一章 重构,夜未眠笔记
1.1 重新规划android的项目结构 重新规划android的目录结构分两步: 1.建立AndroidLib类库,将与业务无关的逻辑转移到AndroidLib. acitivity存放的是 ...
- javascript进击(七)Ajax
AJAX AJAX = Asynchronous JavaScript and XML(异步的 JavaScript 和 XML). AJAX 不是新的编程语言,而是一种使用现有标准的新方法. AJA ...
- Bootstrap与tab组合,切换菜单实例
<html><head><meta http-equiv="Content-Type" content="text/html; charse ...
- [Form Builder]APP_ITEM_PROPERTY.SET_PROPERTY 用法
ORACLE 推荐使用此种方法来控制ITEM属性,虽然实质也是调用set_item_instance_property和set_item_property ALTERABLE app_item_pro ...
- JavaScript无限极菜单
<!DOCTYPE html> <html> <head> <title> New Document </title> <meta c ...
- Openfire3.8.2在eclipse中Debug方式启动最简单的方式
一.前言 最近打算研究一下Openfire,于是打算最好能够以Debug方式启动Openfire的Server,到网上一搜,还果真早到官网的一篇文章来: http://community.ignite ...
- JAVA Web.xml 加载顺序
web.xml加载过程(步骤): 1.启动WEB项目的时候,容器(如:Tomcat)会去读它的配置文件web.xml.读两个节点: <listener></listener> ...
- virtualbox安装ubuntu出现“The system is running in low-graphics mode”
cd /etc/X11 sudo mv xorg.conf.failsafe xorg.conf sudo reboot 即可.