Python in 30 Days: A Practical and Theoretical Approach for Beginner.

Day 3 : Python Syntax: Basic Concepts After -” Hello, World!”
We’ve written your first Python program with “Hello, World!” Day 2 it’s time to dive into some more basic syntax.
This will help you get comfortable writing Python code that does more than just print text to the screen.
We will use live Editor to run each program of Python
1. Variables and Data Types
In Python, variables are used to store information.
Here’s how to create variables and assign them values:
# Assigning values to variables
name = "John"
age = 25
height = 5.9
# Printing variables
print(name) # Output: John
print(age) # Output: 25
print(height) # Output: 5.9

Explanation:
- Strings are enclosed in quotes (
" "
or' '
). - Integers are whole numbers like
25
. - Floats are decimal numbers, like
5.9
.
2. Basic Arithmetic Operations
You can perform arithmetic operations using operators like +
, -
, *
, /
, and others.
# Basic Arithmetic
a = 10
b = 5
sum = a + b # Addition
difference = a - b # Subtraction
product = a * b # Multiplication
quotient = a / b # Division
modulus = a % b # Modulus (remainder)
power = a ** b # Exponentiation
print(sum) # Output: 15
print(difference) # Output: 5
print(product) # Output: 50
print(quotient) # Output: 2.0
print(modulus) # Output: 0
print(power) # Output: 100000

Summary
- Variables and Data Types: Storing data like strings, integers, and floats.
- Arithmetic Operations: Performing calculations.
Tomorrow we will learn
Strings: Working with text and manipulating strings.
Lists: Storing and accessing multiple items.
Happy Coding and Stay Tuned 🙂
Kind is always cool !!!
Share knowledge to gain knowledge !!!!
Be kind and treat people with respect !!!
If you find my blog helpful, then please subscribe, claps and follow to support 🙂

Markandeya Rishi Temple – Mythology & Forest Serenity in Bilaspur/Hamirpur Border
Introduction Nestled…
Nadaun – Riverside Ghats, History & Hidden Temples in Hamirpur
Introduction Set…
Awah Devi Temple – Sunrise Views & Spiritual Energy in Hamirpur
Introduction Perched…
Sujanpur Tira Fort & Temples – A Historical Riverside Town in Hamirpur
Introduction Tucked…
Baba Balak Nath Temple – Faith, Devotion & Eternal Blessings in Hamirpur
Introduction Among…