- 博客(16)
- 收藏
- 关注
原创 C++的链式赋值
C++的链式赋值 我们都知道在C++中,形如 a = b = c 这种链式赋值的结果是将c的值赋给a和b。 那么如果我们在这种链式赋值中加入括号会怎么样呢? int main(){ int a = 1, b = 2, c = 3; (a = b) = c; cout << a << endl << b << endl << c ;...
2018-11-29 20:47:44
1706
原创 数据库中码、超码、主码、候选码
码 码是一个或多个属性的集合。 超码 是一个或多个属性的集合,超码中的这些属性可以让我们在一个实体集中唯一地标识一个实体。 候选码 候选码是极小的超码集,也就是它的任意真子集都不是超码,而他本身是超码。 主码 主码是被选中用来在一个关系中区分不同元组的候选码。...
2018-11-22 20:39:38
23769
原创 scipy练习题
Exercise 10.1: Least squares Generate matrix A ∈ Rm×n with m > n. Also generate some vector b ∈ Rm. Now find x = argminxkAx−bk2. Print the norm of the residual.import numpy as np import scipy.lina...
2018-06-21 12:51:30
415
原创 matplotlib 练习题
matplotlib 练习题.11.1:代码:#! usr/bin/python # -*- coding: UTF-8 -*- import matplotlib.pyplot as plt import numpy as np x = np.linspace(0, 2, 1000) y = np.power(np.sin(x - 2) , 2) * np.power(np.e, np.pow...
2018-05-29 16:47:20
790
原创 Numpy Exercise
Numpy Generate matrices A, with random Gaussian entries, B, a Toeplitz matrix, where A ∈ R n×m and B ∈ R m×m , for n = 200, m = 500. Exercise 9.1: Matrix operations Calculate A + A, AA > ,A > A ...
2018-05-23 13:35:19
240
原创 LeetCode 64. Minimum Path Sum
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. Note: You can only move either down or right at a
2018-05-01 01:32:38
172
原创 py第十章习题
#10-6 a = input('Please input two numbers.') b = input() try: a = int(a) b = int(b) re = a + b except ValueError: print('Please input number.') else: print(str(a) + ' + ' + str(b) + ' = ' + str(r...
2018-04-26 11:31:43
191
原创 py第九章习题
#9-1 class Restaurant(): def __init__(self,name,type): self.name = name self.type = type def describe_restaurant(self): print('The restaurant`s is ' + self.name) print('Our type is ' + self
2018-04-23 16:49:26
141
原创 py第八章习题
#8-1 def display_message(): print('Function!!!') display_message() display_message() display_message() #8-2 def favorite_book(title): print(title + ' is my favourite book!!') favorite_book('Dark')
2018-04-01 13:48:36
246
原创 py第七章习题
#7-1 car = input('Which car do you want?\n') print('Let me see if I can find you a ' + car + '.') #7-2 peo = input('How many people comes to have supper? ') peo = int(peo) if peo > 8: print('Sorry,
2018-04-01 10:49:48
192
原创 py第六章习题
#6-2 fav_nums = { 'John': 3, 'Smith': 100, 'Hans': 250, 'Lily': 399, 'Tylor': 7, } for person,num in fav_nums.items(): print(person + '`s favourite num is ' + str(num)) #for fav_num in fav_nums
2018-03-25 18:25:25
433
原创 py第五章习题
#5-2 str1 = 'father' str2 = 'dad' str3 = 'father' print(str1 == str2) print(str1 == str3) print() #5-4 alien_color = 'green' if alien_color == 'green': print('You got 5 scores') else: print('You go
2018-03-24 10:48:44
213
原创 py第四章习题
#4-1 pizzas = ['chicken', 'fruit', 'beef'] for pizza in pizzas: print(pizza) for pizza in pizzas: print('I love ' + pizza + '.') print('I love pizza~!!!!') print() #4-2 animals = ['dog', 'cat', 'pi
2018-03-17 14:41:26
231
原创 py第二章习题
#2-1 message = 'Hey,py!' print(message) #2-2 message = 'Hey,py!' print(message) message = 'Bye,py!' print(message) #2-3 name = 'Taylor' print(name + ", how are you today?") #2-4 name = 'Taylor' pri...
2018-03-09 10:48:41
222
原创 初入python的感受
由于之前一直是使用C和C++语言来编写代码的,这次在高级编程技术课上接触到python这门语言,我就被它的各种特性惊艳到了。之前只是略有耳闻使用python编写程序很方便,省去了内存管理等等诸多不便,但只有在自己亲身体会之后才真正感受到了python的魅力所在。 比如python使用变量前不需要去定义变量的数据类型,这比C++方便很多,当然也可能会引出一些弊端,但是在我看来是利大于弊...
2018-03-09 10:30:01
855
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅