当前位置: 首页 > news >正文

python教程修订版

9/23

In this course, I'm going to teach you everything you need to know to get started programming in Python.

Now, Python is one of the most popular programming languages out there在众多的……中.

And it's by far目前为止 one of the most sõught after受欢迎的 for jobs.

And so if you're trying to get a job or you're trying to ãutömāte自动化 your life or you're trying to write awesome scripts to do a bunch of一堆 different things, then Python's for you.

Honestly, more and more developers every day are moving their projects over to Python because it's such a powerful and it's such an easy to use language.

A lot of programming languages out there just aren't very beginner friendly.

There's a lot of sỳntax.

There's a lot of like little things that if you get wrong, the program will yell at you.

Python is the complete opposite of that.

You basically just type out what you want to do and Python does it.

It's that simple.

There's not a whole lot of大量的 syntax to learn.

The learning cûrve曲线 is litërälly字面意义的 zero.

You jump in, you can start writing your first program in seconds.

In this course, I'm going to teach you guys everything you need to know to get started in Python.

I designed this course, especially for Python.

And each lesson has been specially designed with examples that will help you along the way.

with so many people starting to learn Python.

The question isn't why should you learn Python? The question is, why shouldn't you?

And I think for a lot of people the reason they might not want to learn Python is because they're intimidāted害怕担心 or they're afraid that it's going to be too hard.

Trust me, I am going to hold your hand through this èntīre全部的 course.

We're going to talk about all the cõre concepts核心概念 in Python.

We're going to look at everything you need to know to start programming in Python and start being confïdënt自信的 and start writing scripts and start writing programs that are awesome and doing cool things in your life.

Anyway, I'm super pûmped to迫不及待 be teaching you guys Python.

I can't wait to get started in this course.

And I hope you guys stick around逗留 and follow along with the course and learn this amazing programming language.

In this tūtõríäl教程, I'm going to show you guys how to install Python onto your computer.

And we're also going to install a text editör文本编辑器 that we can use to write our Python programs in.

So the first order of business首要任务 is to actually install Python on your computer.

So what we want to do is head over前往 to our web browsër浏览器.

And you want to go over here to this page, it's just www.python.org forward slash正斜杠/ downloads.

And on this page, there's going to be two buttons down here.

And it's just going to say download Python 3.6.3.

And at least that's the version that I have right now.

or download Python 2.7.1.4.

So here's the thing about Python, there's actually two mājör主要的 versions of Python that are in use cûrrëntly目前.

There's Python two, and there's Python three.

So you can see over here, this is like 2.7.1.4.

Basically, any Python two version we would just refer to as like Python two.

And here's like the latest Python three version.

And so there's these two versions that you can download.

And the first thing we have to decide is which version do we want to download.

9/24

And here's the basic difference:  
Python two is a legäcy遗留 version of Python,  
which basically means that it's like an old version,  
and it's not being like actively积极 maintained维护 or süppõrted提供帮助 like öfficiälly官方的,正式的 by Python anymore.  
Python three is like the future of Python.  
It's like the newest version.  
It's the one that's getting actively maintained and supported.  
And so there's prōs优点 and cõns缺点 to picking either one.  
A lot of people will say like Python two has been around longer.  
And so there's more like libraries,  
there's basically just more Python code written in Python two.  
So therefore, like there's a few more things that you can do in Python two than you can do in Python three.  
But then again另一方面, Python two is not supported.  
And you know, five or 10 years from now, probably no one's going to be using it.  
Python three, like I said, is like the future of Python.  
It's the newest version.  
It's the one that, you know, is sort of有点算是 being maintained going forward今后.  
So for the pürpöses of 为了this tutorial, I'm going to be teaching you guys Python three.  
So we're going to want to download Python three.  
Now here's the thin·g, like, if you learn Python three or you learn Python two, the differences aren't very big.  
There are a few differences in like some syntax and just some, you know, little things here and there.  
But if you learn Python three, you'll be able to jump right in and code in Python two as well.  
Don't let anyone, you know, tell you that you have to learn one or the other;  
we're going to learn Python three just because it's I think probably the best for a beginner to learn.  
And so that's the one that we want to download.  
So I'm just going to click点击 download Python three.  
And we're going to go ahead and download this version.  
And when that's done downloading, I'm just going to head down to my downloads fōldër文件夹.  
And you'll see here, we just have this file,  
I'm just going to double click.  
And we get this like Python installer.  
So I'm just going to click through here.  
And we'll be able to install Python three on our computer.  
All right, when that's done installing, we can just close out of this,  
and we should be good to go准备好了.  
So now we have Python three installed on our computer.  
The next step is we need to choose a text editor.  
So we're going to be writing a bunch of code.  
So we're going to need some, you know, ènvīrönmënt环境 or some program that we can write all that code in.  
And really, you can write Python in any text editor;  
you could write it in like notepad or text edit, it doesn't really matter.  
But there are special text editors that are designed just for writing Python code.  
And these are called IDEs.  
And that stands for...的缩写 intègrāted集成的 development environment.集成开发环境  
It's basically just a special environment where we can, you know, run and exècúte执行 our Python code.  
And it'll, you know, basically like tell us how we're doing.  
So if we're, you know, if we write something that's wrong or we have errors,  
it'll kind of point us in the right dïrection方向、指引 of what we need to do to fix that stuff.  
So in this course, we're going to be using an IDE.  
And one of my favorites, and one of the most popular IDEs for Python, is called pychårm.  
So I'm over here on this website, it's called https://www.jetbrains.com/pycharm/.  
And this is the IDE that we're going to be using in this course.  
So I'm just going to come over here and click this big download now button.  
And we'll go ahead and download this pycharm program.  
Alright, so I'm getting this page over here.  
You can see there's two versions of pycharm.  
One is a pröfessiönäl专业 version, and that one's like paid, so you have to pay for it.  
But then there's this cömmúnity社区 version down here, and that's free and open sõurce资源.  
So I'm just going to download this one.  
And this should have everything we need to get started using Python.  
Alright, when that finishes downloading, I'm just going to pull that up 打开in my downloads folder.  
And again, we can just sort of run this guy.  
And I'm on a Mac.  
So I'm going to have to drag拖 it over to my applications folder.  
Alright, so we now have pycharm.  
And we have Python three installed on our computer.  
So we're ready to start programming in Python.  
And this tutorial, we're going to create our first Python program.  
And we're going to be able to run it and see how everything works.  
The first thing I want to do is open up pycharm.  
So pycharm was the IDE, the integrated development environment that we downloaded in the last tutorial.  
So I'm just going to go ahead and search for it on my computer.  
And I can just open it up.  
And when we first open up pycharm, we should basically just get a window prompting引导 us to create a project.  
So you can see that down here.  
Actually, the first thing I want to do though is come over here to cönfig[y]üre.  
And I'm just going to click on preferënces偏好.  
And I actually want to change the äppēaränce外观.  
So I'm going to go ahead and give this a thēme主题.  
So I just went over here to appearance and bèhāvíör行为, appearance.  
And I'm going to change the theme to dark.  
Just because I think it's a little bit easier to use and look at.  
But you don't have to do that if you don't want to.  
And so down here, I'm just going to click create new project.  
And it's going to give us this little window right here.  
So I can just name my project.  
And I'm just going to name this draft草稿.  
And then there's this other option选项 down here where it says intërprètër解释器.  
Now, what we want to select is Python version three.  
So if I click down here, you'll notice that there's a couple different options.  
So I'm on a Mac computer.  
And by dèfãult默认, Mac has Python version two installed on it.  
If you're on a Windows mächine机器, I'm not sure if it does.  
But in this tutorial, we're going to be using Python three.  
So you want to make sure that you have Python three selected as the interpreter.  
Other-wise否则, you might not be able to fully follow along with what we're doing in this video.  
So now I'm just going to come down here and click create.  
And this is going to go ahead and create our project for us.  
All right, so now we have our Python project up and running.  
And I want to show you guys how we can create our first Python program.  
So over here in this draft folder, and this is just that project that we created,  
I'm just going to right-click and I'm going to say new.  
And I'm going to come down and click Python file.  
So we want to create a new Python file; this will be our first Python program.  
And I can just give this a name.  
So why don't we just call this app?  
And I'm just going to click okay.  
All right, so now we have our first Python file open.  
And we can just start typing in some Python.  
So I want to show you guys just a very basic Python program.  
And this is just going to be a hello world program.  
So we're just going to print something out onto the scrēen屏幕.  
So what I want to do is I want to type out print.  
And I want to type in open and closed pärenthësēs园括号.  
Now inside of this parentheses, we can make some quōtātion引用 marks.  
And inside of the quotation marks, I'm just going to type out hello world.  
So this is like a very basic Python program.  
And what this is going to do is it's just going to print out hello world onto the screen.  
And so now what I can do is I can actually run this file,  
and we're actually getting a little error here.  
It wants us to create a new line at the end of the file.  
And so now, in order to为了 run our Python program,  
I'm just going to come up here to the top.  
And I'm just going to click run.  
And we'll click this run button right here.  
And now we'll see what happens.  
So it's asking me what I want to run.  
I can just click app.  
And down here at the bottom, you'll notice that...,  
that just got printed out, hello world.  
And so whatever任何 I print, or whatever I put inside of this print stātëmënt指令,  
is going to get printed out down below in the cönsole控制台.  
So as long as只要 you're getting that print statement to work,  
then you've actually written your first Python program.  
And as we go through forward 继续in the course,  
we're going to be writing all sorts of awesome Python programs.  
And we're going to be doing all sorts of cool stuff. In this tutorial, I want to talk to you about writing a basic Python program.  
So we're going to write just a very simple Python program.  
We're going to look at how we can go ahead and write our programs,  
we're going to talk about how our programs are getting executed by Python.  
And we're also going to drãw画 out a little shape形状 onto the screen.  
So this is going to be pretty cool.  
I'm excited to talk to you guys about just the báre basics最基本 of Python,  
and really just sort of give you an intrödûction介绍.  
So over here, we have our basic text editor.  
And so any of the Python code that I write inside of this file  
is actually going to get executed by Python.  
So this Python file has a bunch of Python code inside of it.  
And basically what we're doing when we're programming in Python  
is we're just giving the computer a set of一组 instrûctions命令.  
Right, that's really what programming is;  
it's just like we're specifýing指定 a set of instructions.  
And the computer is going to go off运行 and execute those instructions that we give it.  
And so the more complex复杂 the instructions we give to the computer,  
the more complex the tasks任务 the computer can carry out.  
So I want to show you guys how we can use some Python instructions  
or some Python code in order to draw out a shape onto the screen.  
So I'm actually going to draw out a little trīangle三角形.  
So over here, we can actually print something out onto the screen in Python  
using something called print statements.  
So I can just type out print.  
And inside of these parentheses, I can just type some quotation marks,  
and inside the quotation marks, we can put whatever we want to print out onto the screen.  
So I'm going to copy this and I'm actually going to make a few of these little print statements.  
And we're going to actually draw a shape.  
So we're going to draw like a triangle type shape.  
So down here, I'm just going to draw a forward slash.  
And then up here, I'll make a space空格 and we'll do another forward slash.  
Here, we'll make two spaces, we'll do another forward slash.  
And over here, we're going to make three spaces and a forward slash.  
And now I'm going to draw like vërticäl垂直 bars going all the way down.


http://www.mrgr.cn/news/35083.html

相关文章:

  • 第四节-OSI-网络层
  • 自动化爬虫DrissionPage
  • 内网安全-代理技术-socket协议
  • 阿里巴巴通义灵码推出Lingma SWE-GPT:开源模型的性能新标杆
  • unity基础,点乘叉乘。
  • Maven 中央仓库地址 mvnrepository.com
  • harmonyos面试题
  • YoloV8改进策略:BackBone改进|PoolFormer赋能YoloV8,视觉检测性能显著提升的创新尝试
  • 数据库如何优化,怎么提升性能与效率呢?(建议收藏)
  • MySQL—触发器详解
  • 论文复现:考虑电网交互的风电、光伏与电池互补调度运行(MATLAB-Yalmip-Cplex全代码)
  • ZBrush入门使用介绍——17、NanoMesh
  • React Native 在 build iOS 的时候如果出现关于 `metro` 的错误
  • 阿里发电预测模型:FusionSF
  • 企业如何通过加密软件保护敏感信息和客户数据?
  • 球体检测系统源码分享
  • 利士策分享,如何在有限的时间内过上富足的生活?
  • Rust 是否会重写 Python 解释器与有关的库,替代 C 语言地位?
  • docker从0到1运行mysql(最详细且绝对成功版)
  • Linux构建Debian文件系统
  • 无人机之编程基础原理
  • centos7防火墙白名单总结
  • 23中设计模式,以及三种常见的设计模式demo
  • 一、机器学习算法与实践_04信息论与决策树算法笔记
  • 功能强大的项目管理平台通常融合多种方法论,系统化解决项目管理难点
  • 注意!2024下半年软考考试批次安排已公布