你好 我叫哈里森 欢迎来到有可能是这个python教学系列中最长的一个视频
Hello. My name is Harrison and welcome to quite possibly the longest video in this learn python quick series.
我的目标很简单 就是通过视频帮助 教你快速上手
My goal here is simply. It is to teach you skills quickly but with a visual aid as well.
我发现 当我试着学习python里的一些东西时
I find when I am trying to learn something in python,
很多教程包含许多我并不真正需要的信息
many tutorials contain a lot of information that I’m not really looking for.
那浪费了更多时间
So it consumes more time.
每个视频将主要包含python编程的一个方面
Each video will cover mainly one aspect of python coding
它们会被包括在标题上 使查找和观看变得容易
which will be contained within the title, so it can be found and watched easily.
我会把这些视频按一定顺序排列
I’ll put these videos in somewhat of an order.
如果你刚学python 就能跟随它们
So that if you are newish to python, you can follow them all.
但并不要求要按固定顺序观看
But it’s not required to watch them precisely in order.
我只是期望人们能准确找到他们需要的视频观看
I expect people to just find exactly what they want and watch that.
本系列假定你使用的是2.7版的python 而许多其它版本
These videos will assume you were using python 2.7, many other versions will be
也是通用的
pretty much the same.
剩下的对于需要导入或下载的要求
And also the rest of requirements with either imports or downloads required
会在视频的开头进行说明
will be stating the beginning of any videos.
接着我们学习python中最基本的东西
With that let’s get the most basic thing within python.
这是print 你输入 “print hello” 它就打印出”hello”
And that is print, you put “print hello”, it prints out hello.
你用python能做的最基本的事情之一
So one of the most basic things you can do within python
它所做的就是在控制台显示你指定的任何内容
all this does is display within the console whatever it is you specify.
这是python内置的 所以不需要导入任何东西
This is built into python so there is no need to import anything.
它主要的用途就是用来调试python的脚本
The mainly use for this is going to be debugging the script within python.
由于python是逐行读取的
Since python is a scripting language,
脚本语言
which is read line by line.
它不会中断 直到有一行出错为止
It won’t break until reach a problematic line,
因为打印对于找出错误很有帮助
because of this printing can be somewhat useful to find where the mistake occured
或者甚至找到那些不会导致中断的数学错误
or even to find things like mathematical mistakes that won’t break the script.
可以通过打印出脚本中的位置来分隔函数或代码
You can separate functions or lines of code by print out that says where you are in the script.
还可以打印变量
You can also put in variables.
这里我会向你展示 x=“hello’”,y=“there”
And I’ll show you that here, x equals ‘hello’, y is going to equal ‘there’.
你可以输入 “print x” “print y”
And you can say “print x”, “print y”.
这里错了 “print y” “hello there”
mistake here. Print y, hello there.
就是它了 这就是print函数的全部了
And that’s it. That’s all there is to the print function.