python习题
仗剑逐风
这个作者很懒,什么都没留下…
展开
-
python编程从入门到实践第二章习题答案
请对照相关书籍进行阅读2.1-2.2message = "Hello Python!"print( message )message = "Hello Zhichao"print ( message ) 2.3message = "ada"print( "Hello " + message + ",would you like to learn some Python today?" ...原创 2018-03-07 23:24:42 · 781 阅读 · 0 评论 -
Exercise:Pandas and Statsmodels
Part 1For each of the four datasets...Compute the mean and variance of both x and yCompute the correlation coefficient between x and yCompute the linear regression line: y=β0+β1x+ϵy=β0+β1x+ϵ (hint: us...原创 2018-06-12 16:48:52 · 192 阅读 · 0 评论 -
python编程从入门到实践第十章习题答案
#10-1 文件读取并输出到屏幕with open("learning_python.txt" , "r" ) as file: contents = file.read() print( contents ) print( "********************") for ele in contents: prin...原创 2018-04-05 10:02:33 · 531 阅读 · 0 评论 -
python编程从入门到实践第九章习题答案
#9-1class Restaurant() : def __init__( self , _name , _type ): self.restaurant_name = _name self.cuisine_type = _type def describe_restaurant( self ): print("The name...原创 2018-04-05 09:00:41 · 400 阅读 · 0 评论 -
python编程从入门到实践第八章习题答案
#8-2 喜欢的图书def favorite_book( book ) : print( "One of my favorite books is " , book )name = input( )favorite_book( name )#8-3 T恤def make_shirt( size , text ): print( "The size is :",size...原创 2018-04-01 19:43:17 · 705 阅读 · 0 评论 -
python编程从入门到实践第六章习题答案
#6.1 人people = { "first_name" : 'zetrue' , "last_name": 'Lee' , "age": 20 , "city" : "汕尾" }print( people)for key in people.keys() : print( key , " : " , people[key] )#6.2 喜欢的数字favorite_val原创 2018-03-21 21:57:46 · 1072 阅读 · 0 评论 -
python编程从入门到实践第五章习题答案
#5.2cars = [ 'bwm' , 'audi' , 'subaru' ]a_str = 'BWM'print( a_str == cars[0] )print( a_str.lower() == cars[0] )print( a_str.lower() in cars )print( a_str.lower() not in cars )#5.3-5.5#5.3alien_...原创 2018-03-20 21:42:51 · 322 阅读 · 0 评论 -
python编程从入门到实践第七章习题答案
#7-1 输入输出message = input( "What car do you want?")print( "Let me see if i can find you a ", message)#7-2 判断是否有空桌number = input( "How many people are having the dinner?")number = int( number)if numb...原创 2018-03-29 21:06:25 · 855 阅读 · 0 评论 -
python编程从入门到实践第三章习题答案
3.1-3.2names = ['zhichao' , 'yujie' , 'yifei']for name in names: print( name.title() + " , good night.")3.3transportation = ['car' , 'walk', 'bicycle' , 'motorcycle']for elem in transportatio...原创 2018-03-12 23:27:03 · 2166 阅读 · 0 评论 -
python编程从入门到实践第四章习题答案
4.1pizza = ['a' , 'b' , 'c' ]for ele in pizza : print( ele + " . I like pepperoni pizza." )print( "They are delicious, I like them" )4.2animals = ['dog' , 'cat' , 'bird' ]for ele in animals : ...原创 2018-03-15 08:58:48 · 665 阅读 · 0 评论 -
Exercise: scipy
练习题目与相应代码如下:分析:使用最小二乘法:求出各个列向量线性组合后与b距离最小的线性组合#10.1import numpy as npimport scipy.optimize as opt#m > nm = 20 n = 10A = np.random.normal( loc = 10, scale = 3 , size = (m,n) ) #normalb = np...原创 2018-06-06 14:26:31 · 398 阅读 · 0 评论