原创 3.5python作業

1、看了python主頁,看到python版本的發佈還是非常快的,基本一個月就有一個新版本,而且還是3.6和3.7同時進行的,說明這個語言的更新非常快,在目前具有強大的生命力,而且有橫向的競爭。在主頁看到一些基本的語法,應該是比c/c++

原创 6.13 sklearn

\機器學習相關內容(不是特別懂)簡單的來說就自己隨機生成一個數據集,然後用3種擬合算法擬合,然後評估這個模型擬合的效果。代碼如下from sklearn import datasets from sklearn import model_

原创 3.12python作業

# 3-1 names = ['James', 'Trump', 'Mike', 'John'] print(names[0]) print(names[1]) print(names[2]) print(names[-1]) # 3

原创 4.28python Leetcode 213

213. House Robber IIYou are a professional robber planning to rob houses along a street. Each house has a certain amoun

原创 3.14python作業

# 4-2 animals = ['cat', 'dog', 'tiger'] for animal in animals: print(animal) for animal in animals: print('A '

原创 5.16 numpy exercise

import numpy as np from scipy.linalg import toeplitz import time toep = list(i for i in range(1,501)) A = np.random.no

原创 5.23 Matplotlib

import matplotlib.pyplot as plt import numpy as np import math x = np.linspace(0,2,1000) y = np.power(np.sin(x-2),2) *

原创 6.3 python ipython

在ipython notebook上完成%matplotlib inline import random import numpy as np import scipy as sp import pandas as pd import

原创 4.25python Leetcode 45

45. Jump Game IIGiven an array of non-negative integers, you are initially positioned at the first index of the array.E

原创 4.9python作業

# 11-1city_funcitons.pydef city_function(city, country): return city + ', ' + countryimport unittest from city_func

原创 3.28python作業

# 8-2 def favorite_book(book_name): print("One of my favorite book is "+ book_name) favorite_book('Sherlock') #

原创 5.2python leetcode 120

120. TriangleGiven a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers

原创 4.23python Leetcode array 41

Leetcode41. First Missing PositiveGiven an unsorted integer array, find the smallest missing positive integer.Example 1

原创 3.19python作業

# 5-3 alien_color = 'green' if alien_color == 'green': print('You get 5 points!') # 5-4 alien_color = 'red' if 'gr

原创 3.7python作業

# 2-1 msg = "aa" print(msg) # 2-2 msg = 'aaa' print(msg) msg = 'bbb' print(msg)#2-3 name = "Control_xu" print("Hello