ICT Project, Coding, and Digital Marketing Training!
Struggling with your MSc, BIT, BSc, or HND project? Get guaranteed success with our individual/group online classes taught in English, Sinhala, or Tamil.
✅ PHP & Python Software Development and Automation mySQL Oracle
✅ Digital Marketing & E-Commerce Website Development
✅ Freelancing, Database Design, and AI ML Application Training
✅ All Grade ICT Tutorials, Notes, and Exam Prep
📞 WhatsApp +94 729622034 | 📧 Email: ITClassSL@gmail.com
Programming with Python – Complete Study Guide 2026 Latest Updated for beginners
UNIT 9 – PYTHON PROGRAMMING (A/L ICT Sri Lanka)
Complete guide covering Introduction to Programming, Algorithms, Flowcharts, Python Fundamentals, Control Structures, Data Structures, Functions, File Handling, and Error Handling. This covers the core theory expected for Unit 9 and aligns perfectly with the Sri Lankan A/L ICT syllabus.
9.1 Introduction to Programming
Basic Definitions
Program: A set of instructions given to a computer to perform a task.
Programming: The process of writing, testing, debugging, and maintaining computer programs.
Why Programming? Automates tasks, solves problems efficiently, reduces human errors, and saves time.
Programming Languages
1GL (Machine Language): Binary code (e.g., 10110011). Fast execution but difficult to understand and error-prone.
# Simple IF
mark = 70
if mark >= 50:
print("Pass")
# IF ELSE
mark = 45
if mark >= 50:
print("Pass")
else:
print("Fail")
# IF ELIF ELSE
mark = 80
if mark >= 75:
print("A")
elif mark >= 65:
print("B")
else:
print("C")
Loops (Iteration)
# For Loop
for i in range(5):
print(i)
# Output: 0, 1, 2, 3, 4
# While Loop
i = 1
while i <= 5:
print(i)
i = i + 1
Data Structures: Strings & Lists
Strings
name = "Python"
# Indexing (Starts at 0)
print(name[0]) # Output: P
# Length
print(len(name)) # Output: 6
# 1. Without Parameters
def display():
print("ICT")
display() # Calling the function
# 2. With Parameters
def add(a, b):
print(a + b)
# 3. With Return Value
def add(a, b):
return a + b
result = add(5, 10)
File Handling
Opening Files
f = open("data.txt", "r") # Read Mode
f = open("data.txt", "w") # Write Mode
f = open("data.txt", "a") # Append Mode
Reading, Writing & Closing
# Write to file
f.write("Hello")
# Read from file
data = f.read()
# Always close the file
f.close()
Errors in Python
Syntax Error: Violates grammar rules. Example:if x > 5 (Missing colon at the end).
Runtime Error: Occurs during execution. Example:10 / 0 (Division by zero).
Logical Error: Program runs but produces incorrect output. Example: Using area = length + width instead of area = length * width.
🌟 Frequently Asked A/L Questions
Q1: What are the three control structures? Answer: 1. Sequence, 2. Selection, 3. Iteration.
Q2: Differentiate Compiler and Interpreter.
Compiler
Interpreter
Whole program translated
Line by line
Faster execution
Slower execution
Generates object code
No object code
Q3: Write a Python program to find the largest of two numbers.
a = int(input())
b = int(input())
if a > b:
print(a)
else:
print(b)
Q4: Write a program to print numbers from 1 to 10.
for i in range(1, 11):
print(i)
Q5: Create a list and print all values.
num = [10, 20, 30, 40]
for x in num:
print(x)
🎓 Expert ICT, Coding, School Classes, Digital Marketing & University Project Guidance
Struggling with your university final year project? Want to master coding, upscale your business with expert digital marketing, or learn absolute computer basics from scratch? We offer high-quality individual and group online classes conducted in English, Sinhala, or Tamil mediums. Get guaranteed academic success and professional growth with tailored guidance.
🎓 University Final Year Project Guidance & AI
Get specialized, end-to-end mentoring and technical support to pass your degree or master's program with flying colors:
🏫 Targeted Institutes: Expert guidance tailored for BIT UCSC, UoM, SLIIT, NIBM, and other leading universities.
🔬 Postgraduate Support: Comprehensive assistance for MSc Software Final Year Projects.
🤖 AI & Smart Applications: Step-by-step implementation of AI, Machine Learning (ML), and automation modules.
✅ Guaranteed Success: Help with documentation, system architecture, coding, and viva preparation.
🏫 School ICT & Corporate Beginner Classes
💻 Non-IT Staff Computer Basics: Absolute beginner-friendly online classes covering essential computer skills, office tools, and internet operations.
🎒 Primary & Secondary (Grades 1-10): Interactive online ICT classes tailored to build strong foundations from early ages.
📝 Exam Prep: Dedicated training packages for GCE O/L, GCE A/L ICT, and GIT exams.
🌍 Global Syllabuses: Complete curriculum coverage for Local, Edexcel, and Cambridge in English & Tamil Mediums.
📢 Software Development & Digital Marketing Services
⚙️ Software & Web Development: Professional custom software application and website development built using PHP & MySQL.
🎯 Social Media Management: Content creation, publishing, and channel management for Facebook, Instagram, TikTok, and YouTube.
📈 Ad Boosting: Highly targeted paid advertising campaigns to drive leads, traffic, and sales to your business.
📞 Connect With Us Instantly
Book your slot for online classes or get a premium tech service quote today!
No comments:
Post a Comment