7871人加入学习
(35人评价)
Python零基础入门学习2020最新版(SiKi)

使用Python3.8 于2019/10/20开始录制

价格 免费

字符串:用双引号或者单引号引起来的单词。

例:print("hp")则显示”hp“

如:print(hp)则是显示hp所代表的文本

引号:一个字符串里 有双引号就不能再使用双引号 可以使用单引号

如:同时有单引号和双引号时且字符串的引号不能完全括住文本 可以使用\放于文本引号前

例:message4 = 'my name \' is " siki'

[展开全文]

\  转意字符,针对字符串里需要出现单ying

[展开全文]

print  

\转义字符   改变意义的字符

[展开全文]

hp = 100

print(hp)

hp =90

print(hp)

变量的2个用途:1.存储数据  2.数据变化

字符串输出时,可以使用单引号或者双引号进行输出,如果需要在字符串中加入引号,需要交叉使用单双引号进行输出

m3 = 'i "like" you'
print(m3)

m5 = 'my name \'is "siki'

\转译字符

[展开全文]

1.单双引号都是字符串结束开始.

2.“\(转义字符)”可以在字符串中屏蔽单双引号

    eg:print(“ my name \" is ' houbing”

           输出:my name "is' houbing 

     

 

[展开全文]

字符串变量

m = "hello world"

m2 = 'hello world'

m3 = "hello 'like' you"

m4 = 'hello "like" you'

m5 = "hello 'like\" you"

单双引号都可以,如果字符串里面有双引号,就只能用单引号包含字符串。同样道理,字符串里包含单引号,那字符串只能用双引号包含。

若果字符串里边既包含单引号,也包含双引号,如果想用单引号包含,就得在字符串里的单引号前边加一个\(转义字符)。

 

[展开全文]

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)

 

 

 

 

[展开全文]

转义字符  \  ,放在 ' 或 "   前面

[展开全文]

\?/\/\/\\/\/\/\/\//\/\/\/\\\\\\\\\\\\//////////\/////\/\/\/\/\\\/\/\/\/\/\/\/\/\/\/\/\/\\\\\////\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\//\/\/\/\/\/\/??///\/\/\\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\

[展开全文]

变量不能以数字开头

单引号与双引号的用法

\转义字符

[展开全文]

字符串类型

m='hellow word'

\转义字符

[展开全文]

1.字符串可用单引号或者双引号表示

"hello world" 'hello world'

 

单引号括起来的只能用单引号,双引号同理

中间有引号干扰的使用反斜杠

[展开全文]

第二章

1. x="my name is \"louis\""

print(x)

结果:my name is "louis"

对于字符串:从"(')开始到"(')结束,运用转义字符\规避。

 

 

[展开全文]

授课教师

SiKi学院老师

课程特色

视频(137)
下载资料(1)