- 博客(7)
- 收藏
- 关注
原创 python操作列表
python常用列表操作: 列表名.append(‘yamaha’) —在末尾添加元素 列表名.insert(0,’ yamaha’) —-指定在列表的某个位置添加元素 del motorcycles[0] –删除列表中指定位置的元素 列表名.pop(0) –删除列表中指定位置的元素(以后还可以访问被删除的元素) 列表名[0] = ‘honda’ —修改指定位置元素的值...
2018-04-21 13:48:59 143
原创 论标志的重要性
while 循环 使用while循环 counting.py current_number = 1 while current_number <= 5: print(current_number) current_number += 1让用户选择何时退出 prompt = “\nPlease enter the name of a city you ...
2018-04-21 12:00:50 183
原创 python之while练习
temp = input(‘please give me a num:’) num = int(temp) i = 1 while num: print(i) i = i+1 num = num - 1
2018-04-18 09:49:22 154
原创 python之while,if练习
import random times = 3 secret = random.randint (10,300) print(‘do a word puzzle’) guess = 0 print() print(‘what num is my heart?’) while (guess != secret) and (times >0): temp = input...
2018-04-18 09:47:13 125
原创 python 练习
[wls81@DS145023 hahaha]$ vim testhahah.pytemp = input(‘请输入1到100之间的数字:’) num=int(temp) if 1<=num<=100: print(‘you are beautiful^_^’) else: print(‘you are ugly T_T’)...
2018-04-17 13:02:05 140
转载 zip的使用
tar -zcvf /home/xahot.tar.gz /xahot tar -zcvf 打包后生成的文件名全路径 要打包的目录 例子:把/xahot文件夹打包后生成一个/home/xahot.tar.gz的文件。 zip 压缩方法:压缩当前的文件夹 zip -r ./xahot.zip ./* -r表示递归 zip [参数] [打包后的文件名] [打包的目录路径] 解压 unzi...
2018-03-01 17:54:24 540
转载 解压缩命令
Linux下的tar压缩解压缩命令详解 tar-c: 建立压缩档案 -x:解压 -t:查看内容 -r:向压缩归档文件末尾追加文件 -u:更新原压缩包中的文件这五个是独立的命令,压缩解压都要用到其中一个,可以和别的命令连用但只能用其中一个。下面的参数是根据需要在压缩或解压档案时可选的。-z:有gzip属性的 -j:有bz2属性的 -Z:有compress属性的 -v:显示...
2018-03-01 17:39:53 90
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人