python从入门到实践
FU_Fools
这个作者很懒,什么都没留下…
展开
-
Python:从入门到实践 5-10 检查用户名
current_users = ['a', 'C', 'D', 't', 'u']new_users = ['d', 'k', 'i', 'T']i = 0for current_user in current_users: current_users.pop(i) i = i + 1 current_users.insert(0, current_user.lower())print(current_users) # 这里用来检查列表元素是否都变为小写for new_u原创 2020-06-24 20:23:28 · 453 阅读 · 0 评论 -
python编程:从入门到实践 4—10切片
4-10切片:print("切片")numbers = ['1', '2', '3', '4', '5', '6', '7', '8']lenth = len(numbers)print("the first three items in the list are ")print(numbers[:3])print("three items from the middle of the list are ")print(numbers[2:5])print("the last three i原创 2020-06-22 22:33:38 · 318 阅读 · 0 评论