0% found this document useful (0 votes)
4 views14 pages

Python Lab

C is an imperative, statically typed, compiled language that requires variable declarations and has limited built-in functions, while Python is an object-oriented, dynamically typed, interpreted language that does not require variable declarations and offers a large library of built-in functions. C is generally more complex and harder to learn compared to Python, which is easier to write and read. Additionally, C uses braces for code blocks and requires semicolons to end statements, whereas Python uses indentation and does not require semicolons.

Uploaded by

sumacse537
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views14 pages

Python Lab

C is an imperative, statically typed, compiled language that requires variable declarations and has limited built-in functions, while Python is an object-oriented, dynamically typed, interpreted language that does not require variable declarations and offers a large library of built-in functions. C is generally more complex and harder to learn compared to Python, which is easier to write and read. Additionally, C uses braces for code blocks and requires semicolons to end statements, whereas Python uses indentation and does not require semicolons.

Uploaded by

sumacse537
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

C Python

An Imperative programming model is basically followed by C. An object-oriented programming model is basically followed by Python.

Variables are declared in C. Python has no declaration.

C doesn’t have native OOP. Python has OOP which is a part of the language.

Pointers are available in C language. No pointers functionality is available in Python.

C is a compiled language. Python is an interpreted language.

There is a limited number of built-in functions available in C. There is a large library of built-in functions in Python.

Implementation of data structures requires its functions to be explicitly implemented. It is easy to implement data structures in Python with built-in insert, append functions.

C is compiled directly to machine code which is executed directly by the CPU Python is firstly compiled to a byte-code and then it is interpreted by a large C program.

Declaring of variable type in C is a necessary condition. There is no need to declare a type of variable in Python.

C does not have complex data structures. Python has some complex data structures.

C is statically typed. Python is dynamically typed.

Syntax of C is harder than python because of which programmers prefer to use python instead of C
It is easy to learn, write and read Python programs than C.

C programs are saved with .c extension. Python programs are saved by .py extension.

An assignment is allowed in a line. The assignment gives an error in line. For example, a=5 gives an error in python.

In C language testing and debugging is harder. In Python, testing and debugging are directly not harder than in C.

C is complex than Python. Python is much easier than C.

The basic if statement in c is represented as: The basic if statement in Python is represented as:
if () if:

The basic if-else statement in C is represented as:


if ( ){
The basic if-else statement is represented as:
if :
}
else {
else:

C language is fast. Python programming language is slow

C uses {} to identify a separate block of code. Python uses indentation to identify separate blocks of code.

It is mandatory to mark the end of every statement with a semicolon in C. It is not mandatory to mark the end of every statement with a semicolon in Python.

You might also like