Python foundation - Programming Foundation with Python
Programming logic, Python variables, conditions, loops, functions, debugging and small projects.
What you will cover
Programming logic
Python variables
conditions
loops
functions
debugging
small projects
Topic list from the institute's programme record.
Certification
Certificate terms for this programme are confirmed by the institute at admission. Any ADIVAS course-completion certificate is an institute certificate; it is not a university degree, an externally accredited qualification or a vendor certification (such as AWS or Microsoft) unless the institute states so in writing.
Curriculum 0.1 · Draft: written for ADIVAS and awaiting academic review and approval. Topics and weeks may change before your batch starts.
Your skill trail
You move through 4 stations. Each week builds one skill you can show, not just a topic you have heard.
1
Thinking like a programmer
Turn problems into steps, run a first Python program and use variables and input.
Week 1 Programming logic and first program
Week 2 Variables, types and input
2
Decisions and repetition
Make programs choose and repeat using conditions and loops.
Week 3 Conditions
Week 4 Loops
3
Functions and data structures
Organise code into functions and store data in lists, tuples and dictionaries.
Week 5 Functions
Week 6 Lists, tuples, dictionaries and strings
4
Files, debugging and project
Work with files and CSV, debug and test, then deliver a small project.
Week 7 Files, CSV and errors
Week 8 Debugging, testing and mini project
★
Neighbourhood Shop Billing and Sales Report
Your project, reviewed by a trainer.
The ADIVAS mastery ladder: how each skill is recognised
Explored You have seen the idea and tried a first example.
Practising You can do it with hints and keep improving.
Proficient You complete the weekly practical task correctly on your own.
Proven You apply it in a project reviewed by your trainer.
Skill-level tracking is being added to the learner workspace. Your trainer already reviews weekly practical work.
What you will be able to do
Break an everyday problem into clear steps and express it as an algorithm or flowchart before coding.
Use variables, data types, input and formatted output to build small calculators.
Control program flow with if/elif/else conditions and for/while loops.
Write reusable functions with parameters and return values and test them with sample cases.
Store and process data with lists, tuples, dictionaries and strings.
Read and write text and CSV files and handle common errors with try/except.
Read error messages, debug systematically and write simple test cases.
Plan, build and present a small command-line project and use an AI assistant only with checking.
Who it suits
School Students in Classes 9–12 who are curious about coding, comfortable with basic mathematics and want a gentle, practical start.
College First- and second-year college students who need a solid programming base for coursework, labs and later specialisation.
Professional Working adults and career changers who want to automate small tasks, such as cleaning a CSV of shop sales, and begin a programming path.
Prerequisites: Basic computer skills: files, folders, typing and a browser. Comfort with school-level arithmetic. No earlier programming needed. Tools: Python 3 (current stable release), VS Code or IDLE as the code editor, A terminal or command prompt, Git (optional, introduced in the final week), An AI assistant for guided, checked practice only.
Weekly plan
Thinking like a programmer Weeks 1–2
Week 1: Programming logic and first program
Theory
Algorithms, flowcharts and pseudocode
How Python runs a program: editor, interpreter, output
print(), comments and simple syntax rules
Lab
Install Python and the editor, then write a flowchart and a Python program that prints a school fee receipt header and three lines of text.
Homework
Write pseudocode for making tea and for finding the larger of two numbers.
Deliverable
A hello.py file and a flowchart image for 'find the larger of two numbers'.
Weekly checkpoint
Five questions on algorithms and a short task: fix a program with a missing quotation mark.
You will be able to
Break an everyday problem into clear steps and express it as an algorithm or flowchart before coding.
Week 2: Variables, types and input
Theory
Variables, naming rules and assignment
int, float, str, bool and type conversion
input(), arithmetic operators and f-strings
Lab
Build a bill calculator that reads item price and quantity, adds 18% GST and prints the total with two decimals.
Homework
Write a temperature converter (Celsius to Fahrenheit) and an average-of-three-marks program.
Deliverable
bill.py and a short note explaining each variable name.
Weekly checkpoint
Predict the output of five short snippets, including one str versus int mistake.
You will be able to
Use variables, data types, input and formatted output to build small calculators.
Decisions and repetition Weeks 3–4
Week 3: Conditions
Theory
Comparison and logical operators
if, elif and else
Nested conditions and boundary values
Lab
Write a grade program that converts marks to grades and rejects marks outside 0 to 100; add a ticket price rule by age.
Homework
Write a leap-year checker and a simple electricity slab calculator using given slab rates.
Deliverable
grade.py with at least six sample test inputs listed in comments.
Weekly checkpoint
Trace a nested if on paper and fix a program that uses = instead of ==.
You will be able to
Control program flow with if/elif/else conditions and for/while loops. Read error messages, debug systematically and write simple test cases.
Week 4: Loops
Theory
for loops and range()
while loops, break and continue
Accumulator and counter patterns
Lab
Write programs for a multiplication table, the sum of marks until the user types -1, and a guess-the-number game with limited attempts.
Homework
Print a star triangle and find the factorial of a number using a loop.
Deliverable
loops.py containing three small programs with sample runs pasted as comments.
Weekly checkpoint
Trace a loop table by hand and find the off-by-one error in a range() call.
You will be able to
Control program flow with if/elif/else conditions and for/while loops.
Functions and data structures Weeks 5–6
Week 5: Functions
Theory
def, parameters and return values
Scope: local and global variables
Default arguments and docstrings
Writing small, single-purpose functions
Lab
Refactor the bill calculator into functions: get_price(), add_gst(), format_bill(); write five assert statements to test them.
Homework
Write is_prime(n) and a function that returns the highest of a list of marks.
Deliverable
billing_functions.py with asserts that all pass.
Weekly checkpoint
Code reading: identify why a function prints a value but returns None.
You will be able to
Write reusable functions with parameters and return values and test them with sample cases. Read error messages, debug systematically and write simple test cases.
Week 6: Lists, tuples, dictionaries and strings
Theory
List indexing, slicing and methods
Tuples and sets in brief
Dictionaries for key-value data
String methods: split, strip, upper, replace
Lab
Build a student marks manager: store names and marks in a dictionary, show the average, the topper and a sorted list.
Homework
Count word frequency in a sentence using a dictionary.
Deliverable
marks_manager.py that handles at least five students.
Weekly checkpoint
Predict the output of slicing and dictionary lookups; fix a KeyError.
You will be able to
Store and process data with lists, tuples, dictionaries and strings.
Read a CSV of shop sales (item, quantity, price), compute totals per item and write a summary CSV; handle a missing file and a bad number.
Homework
Write a program that appends a new expense line to a text file and prints the monthly total.
Deliverable
sales_report.py with sample sales.csv and the generated summary.csv.
Weekly checkpoint
Debug a program that crashes on an empty line in a CSV.
You will be able to
Read and write text and CSV files and handle common errors with try/except. Read error messages, debug systematically and write simple test cases.
Week 8: Debugging, testing and mini project
Theory
Reading tracebacks and print debugging
Simple test cases and edge cases
Using an AI assistant responsibly: ask, run, verify
Organising a project and a README note
Lab
Finish and test the mini project, run at least eight test cases and prepare a two-minute demo.
Homework
Write a short README explaining how to run your project and what you would improve.
Deliverable
Final project folder, README and a recorded or live demo.
Weekly checkpoint
Final practical review: run, explain and modify one feature live.
You will be able to
Read error messages, debug systematically and write simple test cases. Plan, build and present a small command-line project and use an AI assistant only with checking.
Sample lessons
Week 3
Making decisions with if, elif and else
A program usually has to choose between actions. An if statement runs a block only when its condition is True. elif adds another condition to check when the first one fails, and else runs when nothing matched. Python decides by indentation: the lines indented under a condition belong to it. Conditions are built with comparison operators such as >, <, == and !=, and joined with and, or, not. Always test the boundary values, such as a mark of exactly 50, because most mistakes hide there.
1Read marks
2Marks >= 90? Print A
3Else marks >= 75? Print B
4Else marks >= 50? Print C
5Otherwise print Fail
The first true condition wins; the rest are skipped.
Step by step
Write the rule in words: marks 90 and above is A, 75 and above is B, 50 and above is C, otherwise fail.
Read the marks with int(input()) and store them in a variable.
Write the checks from the highest limit to the lowest using if, elif and else.
Print the grade, then run the program with 100, 90, 89, 50, 49 and 0.
Add a first check that rejects marks below 0 or above 100.
In real life
A bus ticket counter charges half fare for children below 12 and free travel for senior citizens at 60 and above. The counter software applies exactly this kind of if/elif/else rule.
Worked example
Problem. Write the grade logic for marks and say what is printed for 75.
Solution. marks = 75
if marks >= 90:
print('A')
elif marks >= 75:
print('B')
elif marks >= 50:
print('C')
else:
print('Fail')
The first condition is False, the second is True because 75 >= 75, so B is printed and the remaining branches are skipped.
Common mistakes
Using = (assignment) instead of == (comparison) in a condition.
Ordering elif checks from lowest to highest so a high mark is caught by the wrong branch.
Forgetting the colon or the indentation under a condition.
Try it yourself
Write a program that prints whether a number is positive, negative or zero.
Write an electricity bill rule with two slabs and test the boundary units.
Week 7
Reading a CSV file safely
Much real data lives in CSV files, where each line is a row and commas separate the columns. Python's csv module reads them for you, so you do not have to split lines yourself. Everything read from a file is text, so numbers must be converted with int() or float(). Files can be missing and rows can contain bad values, so wrap the risky code in try and except and report a clear message instead of letting the program crash. Using with open() closes the file automatically.
1Open sales.csv
2Read each row
3Convert qty and price to numbers
4Add to total or report bad row
5Print summary
Read, convert, total, and handle bad rows.
Step by step
Create sales.csv with a header line item,qty,price and four sample rows.
Open the file with with open('sales.csv', newline='') as f and create csv.DictReader(f).
Loop over the rows, converting qty and price to numbers inside try.
Add qty * price to a running total in a dictionary keyed by item.
Catch FileNotFoundError and ValueError and print a friendly message.
In real life
A stationery shop exports a day's sales from a billing app as a CSV file. A short Python script totals each item and spots rows where the price was typed wrongly.
Worked example
Problem. The file has the rows pen,3,10 and notebook,x,45. How do you total the sales without crashing?
Solution. import csv
total = 0
with open('sales.csv', newline='') as f:
for row in csv.DictReader(f):
try:
total += int(row['qty']) * float(row['price'])
except ValueError:
print('Skipping bad row:', row)
print(total)
The pen row adds 30.0, the notebook row raises ValueError because 'x' is not a number, is reported and skipped, and 30.0 is printed.
Common mistakes
Adding numbers read from a file without converting them from text.
Catching every exception with a bare except, which hides real bugs.
Forgetting that the header row is not data when splitting lines by hand.
Try it yourself
Read a CSV of student marks and print each student's total.
Write a function that returns the rows with a quantity below 5 and test it with three cases.
Try the questions
The same skills are asked at three levels: School (Classes 6–12), College and Professional. Switch the level and the language (English or Tamil), and say how sure you are before you check: knowing what you are unsure about is part of learning.
Classes 6–12: everyday examples, no prior knowledge. Practice only. Nothing here is graded or saved.
Question 1 / 4 · Order the steps of an algorithm
Put the steps of making tea in the order of a good algorithm.
1Boil water
2Add tea powder
3Add milk and sugar
4Strain and serve
Add milk and sugar
Strain into a cup
Add tea powder
Boil water
Projects
Neighbourhood Shop Billing and Sales Report
A small shop in Madurai writes bills by hand and cannot see daily totals. Build a command-line program that takes items, calculates a GST-inclusive bill, saves each sale to a CSV file and prints a daily summary of total sales and the best-selling item.
Tasks
Store the price list in a dictionary and let the user pick items and quantities in a loop.
Write functions for line total, GST and bill printing, each with at least one assert test.
Append every completed bill to sales.csv using the csv module and handle a missing file.
Read sales.csv and print the total sales and the item sold most often.
Reject invalid input such as negative quantities or unknown items without crashing.
Sample input
Items: pen x3 at 10, notebook x2 at 45; GST 12%
Expected output
Subtotal 120.00, GST 14.40, Total 134.40 printed; one line per item saved in sales.csv; summary shows the day's total and the best-selling item.
How it is assessed
Criterion
Weight
Correct calculations and output
30%
Functions, structure and readable names
20%
File handling and error handling
20%
Test cases and debugging evidence
20%
Demo and explanation
10%
Stretch challenge: Add a discount rule for bills above 500 rupees and a monthly summary by reading several days of CSV data.
How you are assessed
Each week: a short quiz mixing code reading, output prediction and one debugging question, one timed lab program with test cases, and a brief reflection on what error was hardest to find.
Practical work. Learners write and run programs on their own machine; trainers check correctness against hidden test cases, ask the learner to explain a line, and request a small live change.
What trainers look for
Weight
Correct, working program
40%
Code clarity and structure
20%
Testing and debugging evidence
25%
Explanation and reflection
15%
Where this can lead
Prepares you to continue into web, data or automation courses.
Builds the logic and debugging base needed for entry-level programming practice.
These describe skills you will build. ADIVAS does not guarantee jobs, placement or salary.
Other programmes in Programming & Software Development