首页 > 技术文章 > Python之旅

ifmyt 2020-09-15 19:16 原文

  • 写在前面:本博主有学上啦!!!!!
  • 然后开始苦逼一般的学习python
  • 所以,要更新python笔记啦,会根据进度更新的呦。

Python之学习

 

输入输出:input() , eval() , print(),fomat

数据类型 int float str chr

循环 :range 

列表操作:append ,insert , remove ,del ,index ,pop ,dir,[:]

      https://www.runoob.com/python3/python3-list.html

条件分支:if else elif

 

 

 

 

 

字符串:

1.strip():把头和尾的空格去掉

2.lstrip():把左边的空格去掉

3.rstrip():把右边的空格去掉

4.replace('c1','c2'):把字符串里的c1替换成c2。故可以用replace(' ','')来去掉字符串里的所有空格

5.split():通过指定分隔符对字符串进行切片,如果参数num 有指定值,则仅分隔 num 个子字符串

 

推荐阅读