Yes php Familiar with , Recently I began to learn some python, Always confused , Special notes , Used to familiarize with python:
1、python Array and php Different ,php Relatively simple and unified , namely array( Including ordinary array and associative array ),python It can be divided into lists [], Tuples (), Dictionaries {}, Different formats , The usage is more flexible

2、python The output statement is unified print,php Different , character string echo, Array print_r

http://www.pythonclub.org/python-basic/print  pyhton Format output

3、python The format is more strict ,php But it's more casual .python Variable assignment , There can be no spaces on either side of the equal sign

4、python The indentation requirements are more stringent , Every sentence must be written in the top case , Indent increase is only used to : After the closing statement , And then you have to go back to the previous indent format

http://blog.csdn.net/lhshu2008/article/details/25793785

http://www.oschina.net/question/89964_62779

5、python mysqldb Return a tuple , You can configure parameters to return to the list

6、python a['a']['b']=1 NameError: name 'a' is not defined,php correct

7、python a={}  a['a']['b']=1; Will make mistakes keyerror “a”, php $a['a']['b']=1; correct

8、python Strong type language ,php Weak type language ,python

>>> "3"+6
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Can't convert 'int' object to str implicitly
>>> "3"+"6"
'36'
>>> "6"-"3"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for -: 'str' and 'str'
   They're all dynamically typed languages vartest = 1  vartest = ‘1’  vartest = [1,2,3]

python There's a type difference :

python and php More related articles

  1. Go/Python/Erlang Comparative analysis and examples of programming languages

    This article mainly introduces Go, From the perspective of contrastive analysis of language . The reason why I choose to be with Python.Erlang contrast , Because as a high-level language , They are quite similar in linguistic characteristics , But the main reason is that I am familiar with these . Go Many of the language features of ...

  2. C++ and python The variable comparison of

    <C++ Medium this and Python Of self contrast > Basically, it's all about functions , From a variable point of view , There's something in common . C++ in , Variables defined in a class are generally called member variables , Or member properties , It belongs only to instance objects , Only ...

  3. Go/Python/Erlang Comparative analysis and examples of programming languages be based on RabbitMQ.Client Component implementation RabbitMQ Reusable ConnectionPool( Connection pool ) Encapsulate a system based on NLog+NLog.Mongo Logging tool class for LogUtil Share based on MemoryCache( Memory cache ) Cache tool class for ,C# B/S 、C/S All projects can use !

    Go/Python/Erlang Comparative analysis and examples of programming languages   This article mainly introduces Go, From the perspective of contrastive analysis of language . The reason why I choose to be with Python.Erlang contrast , Because as a high-level language , They are quite similar in linguistic characteristics , ...

  4. django Learning Series ——python and php contrast

    python and php I've used them all , I don't want to make a very rational analysis here , I just want to talk about my feelings based on my own experience . stay web In terms of development , undoubtedly php More than that . In a way ,php Just for web Custom language ...

  5. install Ubuntu Server18.04( Attached with CentOS Occupied volume and Python Comparison of versions )

    Here is just a demonstration of the installation process of the latest system , Settings and things like that Kali as well as CentOS Be the same in essentials while differing in minor points :https://www.cnblogs.com/dunitian/p/4822808.html#linux and C ...

  6. It's a small matter ——python Make a document comparison

    Use python contrast filename1 and filenam2 The difference of , And write the difference to filename3 in . #!/usr/bin/env python # -*- coding: utf-8 -*- # @ ...

  7. web Framework essence And python Comparison of the three frameworks

    . Import Bootstrap.css ( Development Edition 3.3.7) . still more Bootstrap.js, And introduce jQuery(). . grid system . container,row Must be included in container in ...

  8. Python、R comparative analysis

    One .Python And R Function comparison analysis 1.python And R Faster than speed .python It can be dealt with directly G The data of :R no way ,R When analyzing data, we need to transform big data into small data through database ( adopt groupby) To give R Do analysis , ...

  9. Realization 100 Prime output within (Python And C++ contrast )

    Today from the link http://www.2cto.com/kf/201302/187699.html I see Python Realization 100 Within the prime output algorithm , I feel a lot . Especially those who are among them Python The user of the list generator ...

  10. Python And Golang contrast

    One : Preface Just read a soft article , what did you say? “ Talent is the most effective way to change your life ”, Anyway it , In general, it is the progress of science and technology , If you want to be in the car all the time , You have to keep learning , Just recently I'm going to study Golang, The fire can't be on fire recently , It happens that there are also some Python The base ...

Random recommendation

  1. asp.net webservice return json Data garbled solution

    [WebMethod] public void QueryRiskNotice(string phone) { try { var data = _riskNoticeDal.QueryRiskNot ...

  2. Centos 7 adopt YUM install PHP7 NGINX1.1.8 POSTGRESQL9.5

    Reprint 1. Minimize installation CENTOS7 2. Update source : yum update reboot 3. Install extension source : yum install epel-release 4. Install tool software : yum install w ...

  3. 【BZOJ 3122】 [Sdoi2013] Random number generator (BSGS)

    3122: [Sdoi2013] Random number generator Time Limit: 10 Sec  Memory Limit: 256 MBSubmit: 1442  Solved: 552 Description ...

  4. OpenGL ES 2.0 Way of drawing

    OpenGL ES The drawing methods supported in are roughly divided into 3 class , Including some . Line segment . triangle , Each class includes one or more specific drawing methods . GL_POINTS A series of vertices passed into the rendering pipeline are drawn separately . GL_LINES   Pass in the rendering tube ...

  5. Message push androidpn Deploy

    androidpn The client is deployed in eclipse On , Two things to remember : 1. Direct import projects are from the last century lib This folder , To be changed to libs. Otherwise, it will report an error and no cloud class will be found . 2. If you test on a virtual machine , To put res/raw/a ...

  6. CSS3 banner The label effect of the picture

    discharge body see , You'll see :)

  7. obj-c New features of attributes

    In the past objc We must define the instance method corresponding to the property in the interface , And then in the implementation file " Sync " This attribute , The following code : @interface Foo:NSObject{ NSString *name ...

  8. Ocelot Chinese document - Request aggregation

    Ocelot Allows you to specify aggregation of multiple normal ReRoutes Of Aggregate ReRoutes( Aggregate routing ), And map its response to an object . It is generally used when you have a client making multiple requests to the server , And these requests can be combined into one ...

  9. i++ Is it thread safe ?

    I believe a lot of middle and advanced Java Interviewers have all come across this problem , A lot of people who are not very clear about this must be forced to face . I'm sure I'm still questioning ,i++ There are thread safety issues ? I can only say that I don't know enough , My own level is limited . Let's take a look at the following example ...

  10. hdu 1542

    link :http://acm.hdu.edu.cn/showproblem.php?pid=1542 The question : Find the covering area of the given rectangle Answer key : Using the idea of scanning lines , Let's discretize the coordinates first , Later on y The axis is divided into several rectangles , ...