Python for Loops, Running Totals and range | Python for Absolute Beginners 06
Beginner-level Programming video in Tamil by Programming Line, 5 minutes long, published 6 Oct 2026.
Repeat an instruction for every item in a Python list. This lesson starts with four fictional expenses, builds a for loop, then follows a running total. Add a separate range loop, test an extra item, and check what happens with an empty list. You will learn: - How a loop variable takes each item in turn - How indentation defines the repeated instructions - How to initialize and update an accumulator - Why range(1, 4) stops before 4 - How extra-item and empty-list tests check your reasoning Predict each result before running. The four original expenses total 275; the practice exercise explores how the same loop handles a changed list. Use only the fictional data supplied. CHAPTERS 00:00 Welcome and restore the base list 00:24 Write a loop and predict 00:50 Run the first loop 01:01 Trace the loop variable 01:21 Build a running total 01:58 Predict each running total 02:10 Check the running totals 02:34 Build a range loop and predict 02:59 Check where range stops 03:14 Your turn 03:36 Add an item and run 03:49 Check the five-item result 04:03 Predict an empty list 04:18 Run with no expenses 04:36 Restore the list and recap NEXT LESSON Give each expense meaningful field names. Official references: https://docs.python.org/3.12/tutorial/controlflow.html#for-statements https://docs.python.org/3.12/tutorial/controlflow.html#the-range-function Programming Line | Python for Absolute Beginners Narration: Simran, an AI-generated voice. The lesson uses genuine screen-recorded Python demonstrations. #Python #PythonForBeginners #ProgrammingLine…more
Repeat an instruction for every item in a Python list. This lesson starts with four fictional expenses, builds a for loop, then follows a running total. Add a separate range loop, test an extra item, and check what happens with an empty list. You will learn: - How a loop variable takes each item in turn - How indentation defines the repeated instructions - How to initialize and update an accumulator - Why range(1, 4) stops before 4 - How extra-item and empty-list tests check your reasoning Predict each result before running. The four original expenses total 275; the practice exercise explores how the same loop handles a changed list. Use only the fictional data supplied. CHAPTERS 00:00 Welcome and restore the base list 00:24 Write a loop and predict 00:50 Run the first loop 01:01 Trace the loop variable 01:21 Build a running total 01:58 Predict each running total 02:10 Check the running totals 02:34 Build a range loop and predict 02:59 Check where range stops 03:14 Your turn 03:36 Add an item and run 03:49 Check the five-item result 04:03 Predict an empty list 04:18 Run with no expenses 04:36 Restore the list and recap NEXT LESSON Give each expense meaningful field names. Official references: https://docs.python.org/3.12/tutorial/controlflow.html#for-statements https://docs.python.org/3.12/tutorial/controlflow.html#the-range-function Programming Line | Python for Absolute Beginners Narration: Simran, an AI-generated voice. The lesson uses genuine screen-recorded Python demonstrations. #Python #PythonForBeginners #ProgrammingLine