Python chapter 01

📘 What is Python?

  • Python is a simplehigh-level, and interpreted programming language.
  • Created by Guido van Rossum in 1991.
  • Used for web apps, data science, AI, games, etc.

⚙️ Features of Python

  1. Easy to learn and use
  2. Free and open-source
  3. Portable (works on any OS)
  4. Interpreted (runs line by line)
  5. Object-oriented
  6. Has large libraries

💻 How to Run Python

  • In IDLE (Python Shell)
  • In a code editor (like VS Code or PyCharm)
  • Using online compilers

🔤 Basic Syntax

  • Print Output: print("Hello")
  • Comments: # This is a comment
  • Variables: store data → x = 10
  • Indentation: used for blocks of code (no {})

🔢 Data Types

TypeExampleDescription
int10Whole numbers
float3.14Decimal numbers
str“Hello”Text
boolTrue / FalseLogical values

🧮 Operators

OperatorExampleMeaning
+a + bAddition
a – bSubtraction
*a * bMultiplication
/a / bDivision
%a % bRemainder

🧠 Keywords

  • Special reserved words in Python like:
    ifelseforwhiledefTrueFalseimport, etc.

Leave a Comment

Your email address will not be published. Required fields are marked *