split和strip的使用
我觉得都可以进行分隔,但最大的不同就是一个返回list,一个返回字符串
s1 = 'deng ye xun'
s1.split()
Out[8]: ['deng', 'ye', 'xun']
s1.strip()
Out[9]: 'deng ye xun'
split和strip的使用的更多相关文章
- python字符串的split replace strip
split replace strip是字符串中内置的三个函数,作用分别是分割 替换 去空格 0x01:split split(a,b):用指定的字符(a)分割字符串,可以限制分割的次数(b),返回一 ...
- python join和split和strip用法
python join 和 split方法的使用,join用来连接字符串,split恰好相反,拆分字符串的. strip()为去除开头结尾指定的字符,空着时是去除空白字符\t,\n,\r意思 1.jo ...
- split(),strip,split("/")[-1] 和 split("/",-1)的区别
Python中split()函数,通常用于将字符串切片并转换为列表. 一.函数说明: split():语法: str.split(str="",num=string.count(s ...
- pthon入门之strip()和split()函数简单区分
小白,分享记录学习新感悟 路飞的第一次作业写一个登录的程序,作业的升级需求中有个锁文件的需求,大致上如果用户数错了密码三次将用户写到黑名单上,下次登录锁定: ok基本的要求写完,我们上代码 usern ...
- Python进阶---python strip() split()函数实战(转)
先看一个例子: >>> ipaddr = 10.122.19.10 File "", line 1 ipaddr = 10.122.19.10 ^ SyntaxE ...
- 【转】.strip().split('t')和.strip().split()
https://blog.csdn.net/qq_35290785/article/details/94780620 .strip().split('t')line =' nihao, zhenhao ...
- codeforces 487B B. Strip(RMQ+二分+dp)
题目链接: B. Strip time limit per test 1 second memory limit per test 256 megabytes input standard input ...
- Codeforces Round #278 (Div. 1) B. Strip multiset维护DP
B. Strip Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/487/problem/B De ...
- Codeforces Round #278 (Div. 2) D. Strip 线段树优化dp
D. Strip time limit per test 1 second memory limit per test 256 megabytes input standard input outpu ...
随机推荐
- 苹果官方xcodeprojectbuild设置指南
https://developer.apple.com/library/ios/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/ ...
- Java使用ListIterator逆序ArrayList
对于列表而言,除了Iterator,还提供了一个功能更加强大的ListIterator.它可以实现逆序遍历列表中的元素.本示例将使用其逆序遍历ArrayList. 思路分析:要逆序遍历某个列表,首先要 ...
- flexbox父盒子justify-content属性
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- RF--执行案例时动态传入参数方法
通过在运行界面的设定-v 参数值来动态传入:
- 全屏加载loading显示的解决方法
step1:可以在网页里加一个div用来现实loading. <div id="loading"> <!--这里放你的loading时显示的动画或者文字--> ...
- requests 安装
requests 是用来发送 HTTP 请求的一个库,requests 是对 urllib 和 urllib2 进行封装的一个模块,用来取代 urllib 和 urllib2,可以使用以下两种方法安装 ...
- Kafka 0.11版本新功能介绍 —— 空消费组延时rebalance
在0.11之前的版本中,多个consumer实例加入到一个空消费组将导致多次的rebalance,这是由于每个consumer instance启动的时间不可控,很有可能超出coordinator确定 ...
- delphi调用存储过程
一 . TAdoQuery对象下 1. mysql存储过程 sqls := Format(' call pro_addOneStudent (' + '''%s'',''%s'',''%s'',''% ...
- XML读取(string形式进行读取)
#region 测试XML二进制读取 string strXmlData = "<xml><ToUserName><![CDATA[gh_ef65912f88f ...
- WP8.1学习系列(第八章)——透视Pivot设计指南
在本文中 描述 应做事项和禁止事项 其他使用指南 相关主题 重要的 API Pivot class (XAML) PivotItem class (XAML) Windows Phone 应用:具有透 ...