1. Introduction: From Python to C

1.1 Key Differences Overview

Aspect Python C
Compilation Interpreted Compiled
Type System Dynamic typing Static typing
Memory Management Automatic Manual
Syntax Style Indentation-based Brace-based
Performance Slower execution Faster execution
Development Speed Faster to write More verbose

Some of you might ask, What does it mean by Static Typing vs Dynamic Typing ?

Dynamic Typing ( Python ):

# Python - Dynamic Typing
x = 5        # x is an integer
x = "Hello"  # Now x is a string (allowed!)
x = 3.14     # Now x is a float (also allowed!)

Static Typing ( C ):

// C - Static Typing
int x = 5;           // x is declared as integer
x = "Hello";         // ERROR! Cannot assign string to integer variable
float y = 3.14f;     // y must be declared as float to store decimal numbers

Advantages of Static Typing ( C ):

Advantages of Dynamic Typing ( Python ):

1.2 Basic Program Structure

Python:

# Simple Python program
print("Hello, World!")

C:

#include <stdio.h>

int main() {
    printf("Hello, World!\n");
    return 0;
}

Key Points:


Revision #2
Created 2025-09-01 03:31:31 UTC by DS
Updated 2025-09-01 03:33:03 UTC by DS