- 博客(7)
- 收藏
- 关注
原创 python学习第8周(3): LeetCode 11. Container With Most Water
题目:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find...
2018-04-29 23:28:08 103
原创 python学习第8周(2): LeetCode.63. Unique Paths II 题解
这是一题动态规划的题目。若一个格子可达,则到达这个格子的路径数等于到达其上一个格子的路径数与到达其左格子的路径数的和;否则到达这个格子的路径数为0.题目:A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can onl...
2018-04-29 19:15:07 169
原创 python学习第8周(1):LeetCode45. Jump Game II题解
题目:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Your go...
2018-04-28 11:35:56 282
原创 python学习第6周
#11-1city_functions.pydef city_country(city, country): return (city + ", " + country).title()test_cities.pyimport unittestfrom city_functions.py import city_countryclass CitysTestCase(u...
2018-04-15 15:31:00 120
原创 python学习第5周(2)
#10-1with open(r'learning_python.txt') as file_object:#linefor line in file_object:print(line.rstrip())with open(r'learning_python.txt') as file_object:#filecontents = file_object.read()print(...
2018-04-05 00:59:14 107
原创 python学习第5周(1)
#9-3class User():def __init__(self, first_name, last_name, sex, country):self.first_name = first_nameself.last_name = last_nameself.sex = sexself.country = countrydef describe_user(self):messa...
2018-04-04 23:22:47 160
原创 python学习第4周(2)
#8-1def display_message():print("I learn function in this chapter.")display_message()#8-5def describe_city(city_name, country = "China"):print(city_name + " is in " + country)describe_city("Gua...
2018-04-01 23:20:49 122
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人