Learning coding means GreatToCode Be more than a Coder ! Greattocode , Join GreatToCode Community,1000+ Students Trusted On Us .If You want to learn coding, Then GreatToCode Help You.No matter what It Takes !


CODE YOUR WAY TO A MORE FULFILLING And HIGHER PAYING CAREER IN TECH, START CODING FOR FREE Camp With GreatToCode - Join the Thousands learning to code with GreatToCode
Interactive online coding classes for at-home learning with GreatToCode . Try ₹Free Per Month Coding Classes With The Top Teachers . Python Fundamentals – With Deep Explanation

Python Fundamentals – With Deep Explanation

Become More Then A coder | Learn & Start Coding Now.

🧱 1. Printing Output

# The print() function is used to display output in Python.
print("Hello, Arvind!") # This will show the text on the screen


🧠 2. Variables and Data Types

Variables store data so you can use it later.

# String: text inside quotes
name = "Arvind"

# Integer: whole number without decimal
age = 25

# Float: number with decimal
height = 5.9

# Boolean: True or False values (used in logic)
is_student = True

# Displaying them
print("Name:", name)
print("Age:", age)
print("Height:", height)
print("Is Student:", is_student)


🧮 3. Mathematical Operations

a = 10
b = 3

print("Addition:", a + b) # 13
print("Subtraction:", a - b) # 7
print("Multiplication:", a * b) # 30
print("Division:", a / b) # 3.333...
print("Floor Division:", a // b) # 3 (no decimals)
print("Remainder:", a % b) # 1
print("Power:", a ** b) # 1000 (10^3)


🧵 4. Strings in Detail

Strings are text. You can manipulate them easily.

text = "Python Is Fun"

print(text.upper()) # Converts to UPPERCASE
print(text.lower()) # Converts to lowercase
print(text.title()) # Capitalizes Every Word
print(len(text)) # Number of characters
print(text[0]) # First letter → 'P'
print(text[-1]) # Last letter → 'n'

🎤 5. User Input

You can get input from the user using input().

# name = input("What is your name? ")
# print("Nice to meet you, " + name)

> ❗️Note: In most IDEs or online compilers, input() works only when running the script, not in notebook cells.

🔀 6. Conditions (if, elif, else)

age = 20

if age < 18:
    print("You are a minor.")
elif age == 18:
    print("You just became an adult!")
else:
    print("You are an adult.")

> Python uses indentation (space) to define blocks (like if-else). Be consistent with it.

📦 7. Lists (like arrays)

# A list stores multiple items
fruits = ["apple", "banana", "cherry"]

print("First fruit:", fruits[0]) # apple
print("Total fruits:", len(fruits))

# Adding a new fruit
fruits.append("orange")
print("Updated list:", fruits)

# Removing a fruit
fruits.remove("banana")
print("After removal:", fruits)

🔁 8. Loops

🔄 FOR loop (used to repeat over items in a list)

for fruit in fruits:
    print("I like", fruit)

🔄 WHILE loop (runs while a condition is True)

count = 1
while count <= 3:
    print("Count is:", count)
    count += 1


🛠️ 9. Functions (Reusable Blocks of Code)

# Define a function
def greet_user(name):
    print("Hello", name + "! Welcome to Python.")

# Call the function
greet_user("Arvind")

📦 Summary (So Far)

Concept Purpose

print()- Output something
Variables- Store data
input()-Get user input
if statements- Make decisions
Lists -Store multiple values
Loops- Repeat code
Functions - Reuse code

Post a Comment

0 Comments

•Give The opportunity to your child with GreatToCode Kid's • Online Coding Classes for Your Kid • Introduce Your kid To the world's of coding
•Fuel You Career with our 100+ Hiring Partners, Advance Your Career in Tech with GreatToCode. •Join The Largest Tech and coding Community and Fast Forward Your career with GreatToCode. •10000+ Learner's+ 90 % placement Guarantee. • Learning Coding is Better with the GreatToCode community .
•Greattocode Kid's •GreatToCode Career •GreatToCode Interview •GreatToCode Professional •GreatToCode for schools •GreatToCode For colleges •GreatToCods For Businesses.
Are you ready to join the millions of people learning to code? GreatToCode Pass is your one-stop-shop to get access to 1000+ courses, top-notch support, and successful job placement. What are you waiting for? Sign up now and get your future in motion with GreatToCode Pass.