- 博客(8)
- 收藏
- 关注
原创 W8-C3(5.1串休) 作业
题号:804题目要求:国际摩尔斯密码定义一种标准编码方式,将每个字母对应于一个由一系列点和短线组成的字符串, 比如: "a" 对应 ".-", "b" 对应 "-...", "c" 对应 "-.-.", 等等。为了方便,所有26个英文字母对应摩尔斯密码表如下:[".-","-...","-.-.","-..",
2018-04-29 18:32:00 427
原创 W8-C2 作业
leetcode竟然有中文版!题号:476题目要求:给定一个正整数,输出它的补数。补数是对该数的二进制表示取反。注意:给定的整数保证在32位带符号整数的范围内。你可以假定二进制数不包含前导零位。示例 1:输入: 5输出: 2解释: 5的二进制表示为101(没有前导零位),其补数为010。所以你需要输出2。示例 2:输入: 1输出: 0解释: 1的二进制表示为1(没有前导零位),其补数为0...
2018-04-29 17:58:48 247
原创 W8-C1 作业
题号:1题目要求:Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use th...
2018-04-29 16:50:25 128
原创 W6-C1 作业
11-1def printnames(city,country): return city.title()+","+country.title()import unittestfrom hello_world import printnamesclass PrintTestCase(unittest.TestCase): def test_print(self): answer=pr...
2018-04-15 11:31:14 268
原创 W5-C2 作业
10-1print("First time:")with open("learning_python.txt") as file_object: contents=file_object.read() print(contents)print("Second time:")with open("learning_python.txt") as file_object: for line...
2018-04-08 11:41:29 634
原创 W5-C1 作业
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(self.restaura...
2018-04-08 10:32:02 163
原创 W4-C2 作业
8-1def display_message(subject): print("I have learned "+subject+"!")subjects=["Unit 1","Unit 2","Unit 3","Unit 4","Unit 5"]for subject in subjects: display_message(subject)8-2def fa
2018-04-01 15:25:05 203
原创 W4-C1 作业
7-1input("What kind of car would you like to rend?")print("Let me see if I can find you a Subaru.")7-2number=int(input("How many people will be there?"))if number>8: print("Sorry, there is no de...
2018-04-01 15:08:06 111
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人