Cat brother teach you to write reptile 001 - print () functions and variables

What is Python?

Without further ado, Syria, directly on the code

import time
print('你来和我做朋友了吗?我好高兴啊!让我来介绍一下自己')
time.sleep(4)
print('有人说:我是迈入人工智能时代的第一道门槛。')
time.sleep(4)
print('这没错,确实有很多人工智能算法都是通过我来实现的')
time.sleep(4)
print('还有人说,我是编程初学者入门的最好选择')
time.sleep(4)
print('这也对,因为我还被称为"胶水语言",是最简洁的编程语言了')
time.sleep(4)
print('但是,对你而言,我究竟应该是什么呢?')
time.sleep(4)
print('其实,我是你实现目的的一个工具,只要你有需求,我就能帮上忙')
time.sleep(4)
print('''我会好好地帮助你,带你紧跟人工智能时代;
我会解放你的双手,帮你提高工作效率;
我能成为你的职场助手,助你升职加薪''')
time.sleep(12)
print('我就像一把万能钥匙,你想用我打开哪个大门,全凭你自己决定')
time.sleep(1)
复制代码

Install python interpreter

python's official website ( www.python.org)

Select downloads

Select windows

Double-click the installation

Python determine whether the installation was successful (see the version of the way)

windows + R ==> Run ==> cmd ==> Open command window

python --version

Installation vscode Editor

Start learning python knowledge

The first program hello world

print('hello world')
复制代码

Variables in python is not the `###

千寻 = '我叫千寻'
print(千寻) # python支持中文, 变量应该先声明再使用
复制代码

Single or double quotation marks can be mixed, but there is no difference

print('一起玩吧')
#括号内是单引号的情况。
print("一起玩吧")
#括号内是双引号的情况。
print("Let's play")
#括号内单双引号同时存在的情况。
复制代码

Sogou input method can tick中文时使用英文标点

can print wrap

Of course, you can not set the wrap ...

print('hello world',end='') # end参数设置结束时的符号, 可以是\t, 可以是其他的, 默认\n
复制代码

Print "Qin Yuan Chun Changsha"

沁园春·长沙 [现代] 毛泽东 独立寒秋,湘江北去,橘子洲头。 看万山红遍,层林尽染; 漫江碧透,百舸争流。 鹰击长空,鱼翔浅底, 万类霜天竞自由。 怅寥廓,问苍茫大地,谁主沉浮? 携来百侣曾游, 忆往昔峥嵘岁月稠。 恰同学少年,风华正茂; 书生意气,挥斥方遒。 指点江山,激扬文字, 粪土当年万户侯。 曾记否,到中流击水,浪遏飞舟!
复制代码

Three ways to wrap

\n

print('沁园春·长沙\n [现代] 毛泽东 \n独立寒秋,湘江北去,橘子洲头。 \n看万山红遍,层林尽染; \n漫江碧透,百舸争流。 \n鹰击长空,鱼翔浅底, 万类霜天竞自由。 \n怅寥廓,问苍茫大地,谁主沉浮? \n携来百侣曾游, 忆往昔峥嵘岁月稠。 \n恰同学少年,风华正茂; \n书生意气,挥斥方遒。 \n指点江山,激扬文字, 粪土当年万户侯。 \n曾记否,到中流击水,浪遏飞舟!')
复制代码

print () default line break

print('沁园春·长沙')
print('[现代] 毛泽东')
print('独立寒秋,湘江北去,橘子洲头。')
print('看万山红遍,层林尽染;')
print('漫江碧透,百舸争流。')
print('鹰击长空,鱼翔浅底, 万类霜天竞自由。')
print('怅寥廓,问苍茫大地,谁主沉浮?')
print('携来百侣曾游, 忆往昔峥嵘岁月稠。')
print('恰同学少年,风华正茂;')
print('书生意气,挥斥方遒。')
print('指点江山,激扬文字, 粪土当年万户侯。')
print('曾记否,到中流击水,浪遏飞舟!')
复制代码

Three marks can be automatically identified wrap

print('''沁园春·长沙
[现代] 毛泽东
独立寒秋,湘江北去,橘子洲头。
看万山红遍,层林尽染;
漫江碧透,百舸争流。
鹰击长空,鱼翔浅底, 万类霜天竞自由。
怅寥廓,问苍茫大地,谁主沉浮?
携来百侣曾游, 忆往昔峥嵘岁月稠。
恰同学少年,风华正茂;
书生意气,挥斥方遒。
指点江山,激扬文字, 粪土当年万户侯。
曾记否,到中流击水,浪遏飞舟!''')
复制代码

print('let\'s go')
复制代码

Variables and assignments

Variable is a container

Naming variables

Assignment and comparison operators

python is strictly case sensitive

there is no python===

== On behalf of congruent

Small summary

operation

Please use the print () function will print out the following Pikachu, three ways

    へ          /|
    /\7       ∠_/
   /  │     /  /
  │  Z _,<  /     /`ヽ
  │          ヽ     /    〉
   Y          `   /    /
  イ●  、  ●    ⊂⊃〈    /
  ()   へ        |  \〈
    >ー 、_   ィ   │ //
   / へ     /  ノ<| \\
   ヽ_ノ    (_/   │//
    7              |/
    >―r ̄ ̄`ー―_
复制代码

Quick Jump:

Cat brother teach you to write reptile 000-- begins .md
cat brother teach you to write reptile 001 - print () functions and variables .md
cat brother teach you to write reptile 002-- job - Pikachu .md print
cat brother teach you to write reptiles 003 data type conversion .md
cat brother teach you to write reptile 004-- data type conversion - small practice .md
cat brother teach you to write reptile 005-- data type conversion - small jobs .md
cat brother teach you to write reptile 006- - conditional and nested conditions .md
cat brother teach you to write 007 reptile conditional and nested conditions - small operating .md
cat brother teach you to write reptile 008 - input () function .md
cat brother teach you to write reptiles 009 - input () function - AI little love students .md
cat brother teach you to write a list of 010 reptiles, dictionaries, circulation .md
cat brother teach you to write reptile 011-- lists, dictionaries, circulation - small jobs .md
cat brother teach you to write a Boolean value, and four reptile 012-- statements .md
cat brother teach you to write a Boolean value, and four reptile 013-- statements - smaller jobs .md
cat brother teach you to write reptile 014 - pk game. md
cat brother teach you to write reptile 015 - pk game (new revision) .md
cat brother teach you to write reptile 016-- function .md
cat brother teach you to write reptile 017-- function - a small job .md
cat brother to teach you write reptile 018--debug.md
cat brother teach you to write reptile 019 - debug- job. md
cat brother teach you to write reptiles 020-- Classes and Objects (on) .md
cat brother teach you to write reptiles 021-- Classes and Objects (a) - Job .md
Cat brother teach you to write reptiles 022-- Classes and Objects (lower) .md
cat brother teach you to write reptiles 023-- Classes and Objects (lower) - Job .md
cat brother teach you to write reptile 024-- decoding coded && .md
cat brother teach you to write reptile 025 && decoding coded - small jobs .md
cat brother teach you to write reptile 026-- module .md
cat brother teach you to write reptile 027-- module introduces .md
cat brother teach you to write reptile 028- - introduction module - small job - billboards .md
cat brother teach you to write Preliminary -requests.md reptile reptilian 029--
cat brother teach you to write reptile reptilian 030-- Preliminary -requests- job .md
cat brother teach you to write 031 reptiles - reptile basis -html.md
cat brother teach you to write reptile reptilian 032-- first experience -BeautifulSoup.md
cat brother teach you to write reptile reptilian 033-- first experience -BeautifulSoup- job .md
cat brother teach you to write reptile 034- - reptile -BeautifulSoup practice .md
cat brother teach you to write 035-- reptile reptilian -BeautifulSoup practice - job - film top250.md
cat brother teach you to write 036-- reptile reptilian -BeautifulSoup practice - work - work to resolve .md movie top250-
cat brother teach you to write 037-- reptile reptiles - to listen to songs .md baby
cat brother teach you to write reptile 038-- arguments request .md
cat brother teach you to write data stored reptile 039-- .md
cat brother teach you to write reptiles 040-- store data - Job .md
cat brother teach you to write reptile 041-- analog login -cookie.md
Cat brother teach you to write reptile 042 - session usage .md
cat brother teach you to write reptile 043-- analog browser .md
cat brother teach you to write reptile 044-- analog browser - job .md
cat brother teach you to write reptiles 045-- coroutine .md
cat brother teach you to write reptile 046-- coroutine - practice - what to eat not fat .md
cat brother teach you to write reptile 047 - scrapy framework .md
cat brother teach you to write reptile 048-- .md reptile reptiles and anti-
cat brother teach you to write reptile 049-- end Sahua .md

Reproduced in: https: //juejin.im/post/5cfbda5ef265da1b667bcd01

Guess you like

Origin blog.csdn.net/weixin_33882452/article/details/91473148