Python Basics Notes for Beginners
Compiled by: Study Resource Team
For academic use only
Introduction
Python is a beginner-friendly programming language widely used in AI, web, and data science.
Hello World Program
print('Hello World')
Variables & Data Types
x = 5 (int), y = 'hello' (string), z = 3.14 (float).
Control Structures
if, else, elif, for loops, while loops.
Functions
def greet(name): return 'Hello ' + name
Lists & Dictionaries
fruits = ['apple', 'banana']
info = {'name': 'Yashodhan', 'age': 25}
File Handling
with open('file.txt','r') as f: data = f.read()
Mini Exercise
Write a program to add two numbers entered by the user.