Home >Backend Development >Python Tutorial >The difference between C and Python

The difference between C and Python

藏色散人
藏色散人Original
2019-02-01 14:23:515543browse

The following are some differences between C and Python.

The difference between C and Python

##C#PythonC is a A language for hardware-related applications. Python is a general-purpose programming language. The imperative programming model basically follows C. The object-oriented programming language basically follows Python. Variables are declared in C. Python has no declaration. C does not have native OOP. Python has OOP, which is part of the language. The pointer has a C language version. There is no pointer function in Python. C is a compiled language. Python is an interpreted language. There are a limited number of built-in functions available in C. There is a large library of built-in functions in Python. The implementation of data structures requires explicit implementation of their functions. It is easy to implement data structures in Python using the built-in insert and append functions. C is compiled directly into machine code and executed directly by the CPU Python is first compiled into bytecode, which is then interpreted by a large C program. Declaring variable types in C is a necessary condition. There is no need to declare a variable in Python. C has no complex data structures. Python has some complex data structures. The syntax of C is more difficult than python because programmers prefer to use python instead of C languageIt is easier to learn, write and read Python programs than C. C programs are saved with a .c extension. Python programs are saved with a .py extension. Allow allocation within a row. Assignment gave an error. For example, a = 5 gives error in python. In C, testing and debugging are harder. In Python, testing and debugging is no more difficult than in C. C is more complex than Python. Python is much easier than CThe basic if statement in c is expressed as: Basic if in Python The statement is expressed as: The basic if-else statement in Python is expressed as: The basic if-else statement is expressed as: C language is fast. Python programming language is slow

Related recommendations:

c tutorialhttp://www.php.cn/course/list/37.html

Python tutorialhttp://www.php.cn/course/list/30.html

This article is about the difference between C and Python Introduction, I hope it will be helpful to friends in need!

if()
if:
if()

...

if:
...

The above is the detailed content of The difference between C and Python. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn