- 博客(5)
- 收藏
- 关注
原创 python操作列表
python常用列表操作: 列表名.append(‘yamaha’) —在末尾添加元素 列表名.insert(0,’ yamaha’) —-指定在列表的某个位置添加元素 del motorcycles[0] –删除列表中指定位置的元素 列表名.pop(0) –删除列表中指定位置的元素(以后还可以访问被删除的元素) 列表名[0] = ‘honda’ —修改指定位置元素的值...
2018-04-21 13:48:59 149
原创 论标志的重要性
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 190
原创 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 160
原创 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 131
原创 python 练习
[wls81@DS145023 hahaha]$ vim testhahah.py temp = 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 166
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人