Python人工智能 - A计划(永久有效期) 扫二维码继续学习 二维码时效为半小时

(7评价)
优惠后 ¥1599.00优惠前 ¥1999.00 双十一全年最大力度限时优惠
1对1 答疑即时回复7天无理由退款30天价保提问必答

服务保障

1对1 答疑

提供专属的一对一在线答疑,快速答疑解惑。

即时回复

及时响应学习咨询,帮助解决问题。

7天无理由退款

购买后7天内可申请无理由退款。

30天价保

购买后30天内如遇降价,可申请价保。

提问必答

对于提问做到有问必答,帮您扫清学习过程中的种种障碍

这里的访问方式现在不适用,使用第二个网址更换参数不能达到获取json文件的目的

[展开全文]
xnxsgjgf · 2020-05-15 · 0

数字类型

整数和浮点数(小数)

整数的运算

res1 = 3+3

Res2 = 5-2

Res3=4*5

Res4=6/9

res5=6//9

Res6=8%5  取模,求余

Res7=4**3  次方

 

 

res1 = 3+3

res2 = 5-9

res3 = 8*2

res4 = 4/3

 

print(res1)#6

print(res2)#-4

print(res3)#16

print(res4)#1.3333333333333333

 

res1 = 3+3

res2 = 5-9

res3 = 8*2

res4 = 4/3

res5 = 4//3

 

print(res1)#6

print(res2)#-4

print(res3)#16

print(res4)#1.3333333333333333

print(res5)#1

 

4//3 两个斜杆把小数部分扔掉

 

res5 = 2//4

print(res5) #0

 

res6 = 7%3

print(res6) #1

 

res7 = 4**3

print(res7) #64

两个乘号求次方

 

 

res1 = 3+3

res2 = 5-9

res3 = 8*2

res4 = 4/3

res5 = 2//4

res6 = 7%3

res7 = 4**3

 

res8 = 3+4*2

 

print(res1)#6

print(res2)#-4

print(res3)#16

print(res4)#1.3333333333333333

print(res5)#0

print(res6)#1

print(res7)#64

print(res8)#11

 

 

[展开全文]
遗失的星空 · 2020-05-11 · 0

1、写一段英文语句到一个变量中,以小写、大写和首字母大写的方式打印出来。

str = "I like YOU"
print(str.lower())#i like you
print(str.upper())#I LIKE YOU
print(str.title())#I Like You

2、下面哪个变量不合法

(1) my_name

(2) Myname

(3) My-name  x

(4) my name   x

(5) print      x

(6) _lower   

(7) 1message   x

(8) Title#     x

[展开全文]
遗失的星空 · 2020-05-11 · 0

变量命名规则 - 变量是由开发者自己命名的,根据需要自己起名

1、只能包含 字母、数字和下划线,不能使用数字开头

2、不能使用Python关键字(一般在notepad++里面有颜色)

命名规范

简单(不要太长)

明了(根据名字知道这个里面存储的是什么)

其他命名我们用到的时候,大家跟着老师来潜移默化的学习

使用变量容易出现的问题,上下写错

 

 

 

 

[展开全文]
遗失的星空 · 2020-05-11 · 0

去除字符串两边的空白

去尾str.rstrip()

去头str.lstrip()

同时str.strip()

 

方法不用记忆,多练习几遍,后面用的时候,回来查,慢慢常用的就记住了,不常用的,也不用记忆,用的时候查询即可

死记硬背 - 没有应用场景不是很好理解,后面用到的时候再查更容易理解方法的作用和这个方法存在的意义

 

字符串使用避免出现的问题

单引号和双引号的问题

字符串里面包含单引号怎么办?

字符串里面包含双引号怎么办?

字符串里面同时包含单引号和双引号? 使用转义字符\

 

Python2和Python3的区别

print “Hello World“(有些包含有些不包含) print(“Hello World”)

新版本的语法跟JavaC#靠近,更加严谨,方便

 

m = " sdkfjsdlkjf f "

m1 = m.lstrip()

print("#"+m1+"#")# #sdkfjsdlkjf f #

m2 = m.rstrip()

print("#"+m2+"#")# # sdkfjsdlkjf f#

m3 = m.strip()

print("#"+m3+"#")# #sdkfjsdlkjf f#

 

 

[展开全文]
遗失的星空 · 2020-05-11 · 0

字符串的拼接(+)

name = “梁”+str+”雯雯”

print(name)

print(“梁”+str+”雯雯”)

空白 - 空格 制表符\t 换行符\n

 

name = "Hello" + " World" + "!"

print("Hello " + "World" + name)#Hello WorldHello World!

print(name)#Hello World!

 

print("a b")#a b

print("a b")#a b

length = len("a b")

print(length)#3

#print(len("a b"))#6

print("a\tb")#a b

print("a\nb")

[展开全文]
遗失的星空 · 2020-05-11 · 0

几个常用方法

str.title()

str.upper()

str.lower()

len(str)

两种方法的区别 一种在前面 一种在后面

 

str.title() 没有影响原来的字符串,给你一个新的字符串

str.title() 把首字母大写

 

 

 

 

m5 = "my nAme is siki"

m6 = m5.title()

m7 = m5.upper()

m8 = m5.lower()

print(m5)#my nAme is siki

print(m6)#My Name Is Siki

print(m7)#MY NAME IS SIKI

print(m8)#my name is siki

 

str.title()把首字母变成大写

str.upper()把所有字母变成大写

str.lower()把所有字母变成小写

len(str)取得字符串的长度

 

m5 = "my nAme is siki"

m6 = m5.title()

m7 = m5.upper()

m8 = m5.lower()

print(m5)#my nAme is siki

print(m6)#My Name Is Siki

print(m7)#MY NAME IS SIKI

print(m8)#my name is siki

length = len(m5)

print(length)#15

 

m = "Hello World"
m2 = 'Hello World'
m3 = 'i "like" you'
m4 = "I'm fine"
#m5 = 'my name \' is " siki'
m5 = "my nAme is siki"
m6 = m5.title()
m7 = m5.upper()
m8 = m5.lower()
print(m5)#my nAme is siki
print(m6)#My Name Is Siki
print(m7)#MY NAME IS SIKI
print(m8)#my name is siki
length = len(m5)
print(length)#15
length1 = len("hello")
print(length1)#5

[展开全文]
遗失的星空 · 2020-05-11 · 0

print() 函数/方法

 

hp = 100

print(hp)

hp = 90

print(hp)

print("hp")

 

字符串类型

使用双引号或者单引号引起来,引起来部分是数据内容

第一个引号代表字符串开始,第二个引号代表字符串结尾

\转义字符

 

m = "Hello World"

m2 = 'Hello World'

m3 = "i "like" you"

报错

m3 = 'i "like" you'

 

m = "Hello World"

m2 = 'Hello World'

m3 = 'i "like" you'

m4 = "I'm fine"

m5 = 'my name \' is " siki'

m5 = "my name \' is \" siki"

print(m3)

 

 

 

 

[展开全文]
遗失的星空 · 2020-05-11 · 0

代码不能写在一行,会报错

 

msg = "Hello World"

print(msg)

print(msg)

print(msg)

print(msg)

print(msg)

 

 

引入变量的作用

当需要重复使用某一个数据时候

m=" "

print(m)

print(m)

print("m")

当需要存储一个需要变化的数据的时候(游戏中某个角色的血量)

 

变量

1,存储数据

2,可以变化

 

程序出错的时候怎么办?

新手最常见的错误 - 变量名写错

[展开全文]
遗失的星空 · 2020-05-11 · 0

数据类型和变量

计算机中的数据是什么

QQ:聊天的文字(字符)发布的说说文字(字符)年龄(数字)

数字和字符是重要数据。

计算机程序就是用来处理数据的

同样 Python 编写的程序也是用来处理数据的。

什么是数据类型

把不同类型的数据进行划分,就是使用数据类型。

目前:数字类型 字符类型 字符串类型

[展开全文]
遗失的星空 · 2020-05-11 · 0

如何更快速的运行 python 代码
    配置 notepad++
    cmd /k python.exe "$(FULL_CURRENT_PATH)"& PAUSE & EXIT
    保存

 

cmd /k python "$(FULL_CURRENT_PATH)"& PAUSE & EXIT

 

百度搜索:“notepad++ python运行”

https://jingyan.baidu.com/article/d5a880eb8ce81813f047cc4b.html

 

Mac OS 下下载 Python 环境
    下载 mac 版 python
    编辑器使用 Sublime Text
    https://www.jianshu.com/p/097362dcdea3

[展开全文]
遗失的星空 · 2020-05-11 · 0

桌面上:HelloWorld.py
C:\Users\souke\Desktop>python helloworld.py
HelloWorld

C:\Users\souke\Desktop>

 

 

C:\Users\souke\Desktop>python helloworld.py
  File "hellowrold.py", line 1
SyntaxError: Non-UTF-8 code starting with '\xal' in file hellowrold.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

C:\Users\souke\Desktop>

 

print("你好,python世界")

支持中文,需要更改编码格式:
格式---转为 UTF-8 编码格式

[展开全文]
遗失的星空 · 2020-05-11 · 0
>>>print("Hello World")
Hello World
>>>

 

集成开发环境(IDE,Integrated Development Environment )是用于提供程序开发环境的应用程序,一般包括代码编辑器、编译器、调试器和图形用户界面等工具。

 

Notepad++官网:

https://notepad-plus-plus.org/

 

下载Notepad++

https://notepad-plus-plus.org/downloads/

下载 Notepad++ v7.8.2 页面

https://notepad-plus-plus.org/downloads/v7.8.2/

[展开全文]
遗失的星空 · 2020-05-11 · 0

python官网:

https://www.python.org/

 

下载Python 3.8

https://www.python.org/downloads/release/python-380/

https://www.python.org/ftp/python/3.8.0/python-3.8.0.exe

 

Install Python 3.8.0(32-bit)

打勾选项:

Install launcher for all users (recommended)
Add python 3.8 to PATH

 

Setup was successful

Disable path length limit
Changes your machine configuration to allow programs,including Python,to bypass the 260 character "MAX_PATH" limitation.

Close

 

C:\Users\souke\python
Python 3.8.0 (tags/v3.8.0:fa919fd,Oct 14 2019,19:21:23)  [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

[展开全文]
遗失的星空 · 2020-05-11 · 0

Windows键 + R键,调用出 运行

exit() 退出python命令行

在 Windows 下搭建 Python 编程环境

1,检查是否已经安装 Python,如有卸载 Python

2,下载并安装 Python (python.ory)(勾选 add python to path)

3,检查是否安装成功

4,编写 HelloWorld

5,安装 notepad++

[展开全文]
遗失的星空 · 2020-05-11 · 0

Python2和3

互不兼容,一些老的项目还在使用2.

新学习使用最新版本3.8

 

新手的计算机基本知识

大小写切换 Windows键 shift键

[展开全文]
遗失的星空 · 2020-05-11 · 0

键值对:

stu1={'name':'siki','age':17,'gender':'男'}

 

[展开全文]
差点没头的哈莉 · 2020-05-11 · 0

\可以用来表示未结束

[展开全文]
冲冲冲女孩 · 2020-05-11 · 0

1.发起请求(HTTP)------>得到响应(HTML)

2.解析HTML,得到我们想要的数据

 

[展开全文]
向阳而笑 · 2020-05-09 · 0