🚀 Day 1/100 – Calculate Attendance Percentage in Python

🐍 Day 1/100 – Introduction to Python & Your First Program

Posted on DataWiz Vamshi


Python is one of the most beginner-friendly programming languages, widely used in data analytics, automation, web development, and AI. In this first post of our Python Basics series, we'll write our very first Python program and understand what's happening behind it.

What is Python?

Python is a high-level, easy-to-read programming language. "High-level" means you write instructions closer to plain English, and Python handles the complex machine-level work for you.

Method 1 – The Classic First Program

Every programmer's first program is usually the same one:

print("Hello, World!")

Output

Hello, World!

Explanation

  • print() is a built-in Python function that displays whatever is inside its parentheses on the screen.
  • Text inside quotes (" " or ' ') is called a string.
  • Python runs code line by line, from top to bottom.

Method 2 – Printing Multiple Lines

print("Welcome to DataWiz Vamshi")
print("Let's learn Python step by step")

Output

Welcome to DataWiz Vamshi
Let's learn Python step by step

Explanation

  • Each print() statement automatically moves to a new line after running.
  • Python executes statements in the exact order they are written.

Method 3 – Using Variables

Instead of typing text directly, we can store it in a variable and reuse it.

brand_name = "DataWiz Vamshi"
print("Welcome to", brand_name)

Output

Welcome to DataWiz Vamshi

Explanation

  • brand_name is a variable — a name that stores a value in memory.
  • You can reuse the variable anywhere instead of retyping the text.
  • A comma inside print() lets you combine text and variables in one line.

Method 4 – Taking User Input

name = input("Enter your name: ")
print("Hello,", name, "! Welcome to Python.")

Sample Input

Vamshi

Output

Hello, Vamshi ! Welcome to Python.

Explanation

  • input() pauses the program and waits for the user to type something.
  • Whatever the user types is stored as text in the name variable.
  • This makes programs interactive instead of fixed.

Comparison of Methods

Method Best For
Basic print() Learning output basics
Multiple Lines Understanding sequential execution
Variables Reusable, dynamic content
User Input Interactive programs

🔥 Key Takeaways

  • print() displays output, and input() collects it — these two functions are the foundation of interaction in Python.
  • Variables let you store and reuse values instead of hardcoding them everywhere.
  • Python runs top to bottom, one line at a time.
  • Every big Python program — including the attendance/data tools we'll build later in this series — starts from these same basics.

Next up: Day 2 — Python Data Types (int, float, string, boolean).

Post a Comment

0 Comments