'Elseprint ' Hello. Stranger '______________________________Num=input (' Enter a number: ")If num>0:print ' The number is positive 'Elif num print ' The number is negative 'Elseprint ' The number is zero '_______________________________ The = = Budget character Determines whether 2 objects are equal, and is to determine whether the two are equivalent (the same object)An Assert statement is available if you need to make sure that a condition in the program must be true for the program to functi
): Passclass Parrot (Bird): Passclass Ostrich (Bird): Passclass Runnable (object): Def run (self): PRI NT ("Running ...") class Flyable (object): Def Fly (self): print ("Flying ...")Multiple Inheritance of classesClass Dog (Mammal, Runnable): Passclass Bat (Mammal, flyable): PassThe mixin in PythonMixin's role is to better see the inheritance relationship, the purpose is to add multiple functions to a class, so in the design class, we have limited con
variables need to be exchanged, a stupid temporary variable is required: c = a; a = B; B = c
a = 'Spam'b = 'Eggs' print(a, b) a, b = b, a print(a, b) Spam EggsEggs Spam
9. Introspection tools
I know the dir () method. I thought it was in the help () method and IPython? Magic commands are the same, but help () is more powerful.
my_dict = {'That': 'an ex-parrot!'} help(my_dict)
Help on dict object: class dict(object) | dict() -> new empty dictionary |
Article 3: Understanding DecltypeDecltype is a very interesting monster. If you provide a name or an expression, the Decltype keyword will tell you the name or the type of the expression. Usually, the results match your expectations. Sometimes, however, the results of Decltype lead you to the point where you go through reference books or ask questions on the web.Let's start with the usual situation-there's no hidden surprises here. In relation to what happens in the template type deduction and a
):@propertydef birth(self):return self._birth@birth.setterdef birth(self, value):self._birth = value@propertydef age(self):return 2014 - self._birth
Multi-Inheritance
Inheritance is an important way of object-oriented programming, because through inheritance, sub-classes can expand the features of the parent class.
First, the main category levels are still designed for mammals and birds:
Class Animal (object ):Pass# Category:Class Mammal (Animal ):PassClass Bird (Animal ):Pass# Various animals:C
What is duck typeJavaScript is a typical dynamic type language, as well as a weakly typed language.What is a duck type: "If it walks like a duck, it's a duck, then it's a duck."var 鸭子 = { 走路: function () { }, 咕咕咕: function () { }}var 鹦鹉 = { 走路: function () { }, 咕咕咕: function () { }}The parrot also has a "walk" and "goo" method, that in the JS world can be used as a duck.This can be called:var 鸭子们 = [];鸭子们.push(鸭子);鸭子们.push(鹦鹉);for (var i = 0; i
.png" src = "http://www.bkjia.com/uploads/allimg/131228/001IG5A-11.png" alt = "185715847.png"/>
Now the common configuration instances of apache have been completed!
Attaches the configuration file that you edited during the entire configuration.
NameVirtualHost192.168.1.107: 80ServerNamehello.magedu.comDocumentRoot "/www/magedu.com"
ServerName_default _DocumentRoot "/www/default"
ServerNamewww.a.orgDocumentRoot "/www/a.org"OptionsnoneAllowOverrideauthconfigAuthTypebasicAuthName "Restrictarea
, very runny, sir.", $Shopkeeper="Michael Palin", -Client="John Cleese", -Sketch="Cheese Shop Sketch"); - A #Splitting of parameters + defParrot (name="Xiaoxiao", age=24): the Print("My name is", name,end="'); - Print("and my age is", age,end="'); $ thestudent={"name":"Jack"," Age": 25}; theParrot (* *student); the thestu=["Jack", 25]; -Parrot (*Stu); in the #pairs = [(1, ' One '), (2, ' One '), (3, ' three '), (4, ' four ')] the #Pa
Effective Modern C ++ translation-Clause 3: Understanding decltype
Clause 3: Understand decltype
Decltype is a very interesting monster. If a name or expression is provided, the decltype keyword will tell you the name or type of the expression. Generally, the results are consistent with your expectations. However, in some cases, the results produced by decltype lead you to seek answers in reference books or online Q .
Let's start from the general situation-there are no surprises here. The declty
pros and cons4. The thirst for new technology learning does not affect selection results, nor can it be feared for the use of new technologies.Oracle,mysql and NoSQL, are just a software, the actual use of the effect depends more on the user's ability. A good user can make full use of its advantages to avoid its soft rib, and ultimately achieve maximum value.Finally, in the process of selection should be fully absorbed in the industry experience, and can not be
Original Address: http://www.cnblogs.com/zhaopei/p/6623460.htmlRead Catalogue
What is duck type
object-oriented JavaScript
Packaging
Inherited
Polymorphic
Prototype
This point
Pager
Apply
Band
The closure in JS
What is a higher order function
It is difficult to really understand and read JS object-oriented code when I write the object-oriented programming Idea-the JS part of the design pattern and find a lot of basic knowledge without und
good, the word translation experience is very good. Other functions are more than the imagination of the whole, feel everything, but are not perfect, also did not find any prominent points. UI design, the interface is a bit flawed, there are some uncomfortable, unnecessary places, such as:1. "Enter or paste the word or sentence to be queried" this section overlaps with the background of a daily sentence (the head of the parrot is Gone), and this desi
Destructor or Dispose. I have not come up with a better solution.Now, the ins and outs of RAII have been clearly stated, and sufficient nutrients can be obtained from C. However, this is not all about RAII, and RAII has more extensions. In Imperfect C ++, Matthew Wilson demonstrated a very important application of RAII. In order not to get lost in the reputation of a parrot, here is a real case. It is very simple: the program I write needs to respond
Multiple inheritance: (Implements the function of the parent class by inheriting subclasses)
Animal may have different classifications:Animal------Mammal------BirdAnimal------Run------FlyFor each animal dog,cat, parrot may be the first category, or it may inherit the second classification at the same time. The dumb way is to define Runmammal,flymammal,flybird. But when more classifications are needed, it is obviously unreasonable. ------Multiple
,message Message) {System.out.println ("Receivedmessage:" + message);}});try{Newchat.sendmessage ("howdy!");}catch (Xmppexceptione) {System.out.println ("Error deliveringblock");}The Chat.sendmessage (string) method makes it easy to create a message object, set the message body body with a string parameter, and then send a message. In some cases you may want to set additional values before sending messages, using the Chat.createmessage () method and the Chat.sendmessage (message) method, as show
) {System.out.println ("Error deliveringblock");}The Chat.sendmessage (string) method makes it easy to create a message object, set the message body body with a string parameter, and then send a message. In some cases you may want to set additional values before sending messages, using the Chat.createmessage () method and the Chat.sendmessage (message) method, as shown in the following code snippet:Messagenewmessage = new Message ();Newmessage.setbody ("howdy!");Message.setproperty ("FavoriteCol
liquciqiong, the colon tone slowed down: "Please do not misunderstand, I am not oop opponents, but also in the future to focus on the discussion of it." But I hope that we can be less scripted and parrot, a little more independent thinking and critical spirit. ”
Pause, the colon continues to ask: "What is the difference between procedural programming and OOP in the design concept?" ”
"Process-type programming philosophy is the emphasis on the proce
Installation Environmentoperating Environment: Parrot Security OS system using software installed under VMware: Bitnami-redmine-3.1. 1-1-linux-x64-installer.runProblem Description:Installation steps similar to the previous article, one-click installation of the Fool, it is worth noting that the installation package is 64-bit, soThe 64-bit Linux machine should be selected when installing the system. Otherwise, the 32-bit machine will have the following
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.