- 博客(6)
- 收藏
- 关注
原创 第八周作业 LeetCode 选做 两题
35. 搜索插入位置题目描述:给定一个排序数组和一个目标值,在数组中找到目标值,并返回其索引。如果目标值不存在于数组中,返回它将会被按顺序插入的位置。你可以假设数组中无重复元素。class Solution(object): def searchInsert(self, nums, target): first = 0 last...
2018-04-25 22:59:05 220
原创 第六周作业 第11章选做
11.1import unittestdef city_functions(city, country): return city.title() + ', ' + country.title()class Test(unittest.TestCase): def test_city_country(self): c_c = city_functions(...
2018-04-16 00:07:14 109
原创 第五周作业b 第10章选做(1、2、4、8)
10.1with open("learning_python.txt")as fob: print("print_1:") data=fob.read() print(data) print("print_2:") fob.seek(0,0) for line in fob: print(line.strip()) print("print_3:") fob.seek(...
2018-04-06 15:01:31 131
原创 第五周作业a 第9章选做(1、2、6、10)
9-1#9.1class Restaurant(): def __init__(self,name,cuisine_type): self.name=name self.cuisine_type=cuisine_type def describe_restaurant(self): print("The restaurant's name is "+self.name+ ".")...
2018-04-06 00:20:42 128
原创 第四周作业b 第8章选做(1、3、7、8)
8-1def display_message(message): print(message)mess=input("Input a message and it will be displayed:")display_message(mess)8-3def make_shirt(size,message): print("The shirt will be made with the ...
2018-04-01 15:52:01 120
原创 第四周作业a 第7章选做(2、5、6、8)
7-2number=int(input("How many people will have a meal?:"))if number>8: print("There is no empty table for so many people.")else: print("There is an empty table.")7-5/6flag=Truewhile(flag): a...
2018-04-01 14:37:03 115
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人