- 博客(5)
- 收藏
- 关注
原创 Leetcode - 35. Search Insert Position 题解
题目:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.E...
2018-04-25 21:37:57 138
原创 Leetcode -19. Remove Nth Node From End of List 题解
题目:Given a linked list, remove the n-th node from the end of list and return its head.Example:Given linked list: 1->2->3->4->5, and n = 2.After removing the second node from the end, the...
2018-04-25 21:26:25 159
原创 《Python编程——从入门到实践》第十一章部分习题解
# 11-1.city_functions.pydef city(city, country): return(city.title() + ', ' + country.title())test_cities.pyimport unittestfrom city_functions import cityclass TestCase(unittest.TestCase): de...
2018-04-11 21:47:19 814
原创 《Python编程——从入门到实践》第十章部分习题解
# 10-1with open('learning_python.txt') as file_object: contents = file_object.read() print(contents) for line in file_object: print(line) lines = file_object.readlines()for line in lines: pri...
2018-04-04 23:24:06 369
原创 《Python编程——从入门到实践》第九章部分习题解
# 9-1class Restaurant(): def __init__(self, restaurant_name, cuisine_type): self.restaurant_name = restaurant_name self.cuisine_type = cuisine_type def describe_restaurant(self): print(se...
2018-04-04 21:57:56 301
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人