深度学习入门DAY1
这里是计算机研0,本人打算在开学之前学习一下深度学习的相关内容,顺便将自己的学习内容进行记录,有兴趣的话就关注一下吧^_^
深度学习入门的第一步当然是python了!!!
python基础
在终端输入python就可以打开python了,这里可以查看版本
以下是一下最基础的语法,没什么好解释的啦,我相信如果你是科班,你一定一看就懂
算术计算
>>>1-2-1>>>2*36>>>3**327>>>7/32.3333333333333335数据类型
>>>type(10)<class'int'>>>>type(2.4)<class'float'>>>>type("hello")<class'str'>变量
>>>x=10>>>y=8.2>>>print(x)10>>>x*y82.0>>>type(x*y)<class'float'>列表
>>>a=[1,2,3,4,5]>>>print(a)[1,2,3,4,5]>>>len(a)5>>>a[2]3>>>a[2]=222>>>print(a)[1,2,222,4,5]>>>a[0:2]#获取下标0-2(不包括2)[1,2]>>>>a[1:]#获取从下标为1开始到末尾的元素[2,222,4,5]>>>a[:3]#获取从第一个元素到下标为3的元素(不包括3)[1,2,222]>>>a[:-2]#获取从第一个元素到最后一个元素的前两个元素之间的元素[1,2,222]字典
>>>me={'height':180}>>>me['height']180>>>me['weight']=70>>>print(me){'height':180,'weight':70}布尔型
>>>hungry=True>>>not hungry False>>>type(hungry)<class'bool'>>>>sleep=False>>>sleepand hungry False>>>sleepor hungry True函数
>>>def hello(name):... print("hello"+name)...>>>hello("X_Bubble")helloX_Bubble>>>