The name is based on a funny joke many years ago on a British television show, "Monty Python's Flying Circus."
VOA: special.2010.08.01
That's the Python saying, that is a command, that is a specific command to get the value of the expression and print it back out.
这代表着Python告诉我们这是一个命令,这是一个,得到表达式的值,并显示的特殊命令。
The second thing I want to highlight is, that what's going on, is that Python is doing some type checking.
我想强调的第二件事情是,这里发生的是,是Python做了一些类型检查的工作。
But there's one thing to think you know, you think of I don't know if you've seen the Monty Python's skit.
但是另外,当您想到,不知道您看没看过Monty,Python的滑稽短剧?
Right now it's got that second key word there called pass, which is just Python's way of saying there's an empty body in here.
现在我在完善它的一个简单部分,但是首先,类是用来干什么的呢?,把类认为是可以创建一个。
It's perfectly legal in Python to type that in and get the value back out.
正如我所说的,我更希望用一个,我刚刚写的访问器。
I don't think either of us are thrilled with the text, it's the best we've probably found for Python, it's OK. If you need it, it's there.
我不认为我们俩对于这个课本很满意,这是我们能找到的,最好的版本了,还不错,如果你需要它,就在网站上。
So in fact what happens inside of an object-oriented system, and particularly in init Python's object-oriented system, is the following.
面向对象系统的内部,尤其是在Python的面向,对象系统的内部的过程,就是如下的,当我们调用,它会去创建一个实例。
I'm using Python's is comparator to say is it the same thing?
来看看这两个东西是不是同一个,它说不是,但是如果我的意思是?
So we've looked at how to solve square root we've, looked at two problems, I've tried to instill in you this sense of paranoia which is so valuable, and now we're going to pull back Python and return to something much simpler than numbers, and that's Python. All right?
我们已经研究了如何去求平方根,研究了两种方法,我一直在尝试着给你们逐渐灌输,要偏执的理念,这样的理念非常有价值,现在我们回过头来去学习一些,比数字更简单的东西,也就是,对不对?数学问题很难?
That's the internal representation that python uses for this. If I give it some other character, yeah, it would help if I could type, give it some other character.
为什么输入‘3’返回了其它的东西?,这是python在内部的表示方式,如果我输入其它的字符,是的,如果我能输入,输入其它的字符。
Python is, I wouldn't say completely strong, but it's much closer to the strong end of the spectrum.
至于Python,我不会说它很强,但是确实在这些语言中,它是比较强的。
It's basically to get you to load up Python on your machine and make sure you understand how to interact with it.
它基本上让你在你的机器上,装Python语言,并确保你理解如何与它互动。
You do need to know how to use it, but it's not about the details of, where do the semi-colons go in Python. All right?
你们确实需要知道怎么使用它,但是并不是具体细节,比如在Python中怎么写分号,好么?
All right. If that sounds like a really long preamble, it is. Let's start with Python.
好,如果上面听起来像一个很长的序文,他确实是,让我们从Python开始。
It's an easy one to make in Python. Lots of assumptions like that.
在Python中你很容易犯这个错,还有很多这样的假设。
So let's look at what some of the traditional methods for classes are in Python.
很奇怪的有下划线的东西,因此让我们来看看Python中,一些传统的方法吧。
OK, you've actually seen exceptions a lot, you just didn't know that's what they were, because exceptions show up everywhere in Python. Let me give you a couple of examples.
好的,你们实际以及看过很多异常了,你就是不知道这些是什么,因为异常在Python中随处可见,我给你举些例子。
应用推荐