python入门学习记录

Posted 断弦有谁知

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python入门学习记录相关的知识,希望对你有一定的参考价值。

--------大小写敏感  
>>> myName=input("Please enter yourname:");
Please enter yourname:zhangyongsen
>>> myAge=input("what about your age:");
what about your age:30
>>> print("Hello World,myname is ",myName,"and i am",myage,"Years old.");
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'myage' is not defined
>>>
>>> print("Hello World,myname is ",myName,"and i am",myAge,"years old.");
Hello World,myname is  zhangyongsen and i am 30 years old.
>>>




三引号
'''或者""" 扩展多行 


>>> print('''Hello World.my
... Name is zhang and i
... am 30 years old.''')
Hello World.my
Name is zhang and i
am 30 years old.
>>>


--转义字符
>>> print('HellO\\nWorLD');
HellO
WorLD
>>>


--打印双引号
>>> print("IAm 5'9\\" tall")
IAm 5'9" tall
>>> print("//");
//
>>> print("\\\\");
\\
>>>
--打印单引号 
>>> print('I am 5\\'9" tall');
I am 5'9" tall
--不转义字符
>>> print(r'Hello\\t world');
Hello\\t world



















以上是关于python入门学习记录的主要内容,如果未能解决你的问题,请参考以下文章

Python3.5入门学习记录-条件控制

python入门学习记录

python入门学习记录

机器学习00:如何通过Python入门机器学习

Python3.5入门学习记录-列表元在字典

python 爬虫框架scrapy学习记录和整理 python爬虫框架scrapy入门文档学习