CBSE 2026 results are out, Mukul scored a perfect 100/100 in Computer ScienceSee all toppers →

KwickAcademy Python · 9 min · free

Class XI Python Revision in One Go

9 min5 KwickClipsFull text belowFree
Next lesson →Kajal Ma'am (MCA), teaching since 2004Remembered in this browser

A fast Class 11 Python revision for Class 12: tokens, data types, operators, flow of control and the four collections, with a quiz. Class 12 Computer Science builds directly on Class 11 Python, so the basics decide how hard functions and files feel.

Follows the syllabus of: CBSE Class 12 Computer Science (083)

On screen in this lesson

Tokens: the smallest units

TokenMeaningExamples
Keywordreserved wordif, for, True
Identifiera name you makemarks, total_1
Literala fixed value45, "Riya", 3.5
Operatordoes an action+, ==, and
Punctuatora symbol for shape( ) [ ] : ,

Data types at a glance

TypeExampleMutable?
int, float45, 3.5No
complex2 + 3jNo
boolTrue, FalseNo
str, tuple"hi", (1, 2)No
list, dict[1, 2], {1: "a"}Yes
NoneNoneNo

Precedence: who goes first

OrderOperatorsNote
1**right to left
2unary -, +-2 ** 2 is -4
3* / // %left to right
4+ -left to right
5< > == !=comparisons
6not, and, orin this order

Four collections, one screen

Featurestr / tuplelist / dict
Brackets" " / ( )[ ] / { }
Mutable?NoYes
Indexed bypositionposition / key
Duplicatesallowedlist yes, keys no
Change itemTypeErrorallowed

Most tested in Class 12 papers

Output prediction: slicing, loops, string methods
Mutable vs immutable, and the errors they cause
List methods: append, extend, insert, pop, remove
Dictionary methods: get, keys, values, items, update
Operators: //, %, ** and precedence

Self-check quiz

What is 7 // 2 * 2 ** 2?
What is "KWICK"[1:-1]?
t = (1,2); what does t[0] = 5 do?
What is len([1, [2, 3]])?
What is {1: 'a', 1: 'b'}?

Quick answers

What is 2 ** 3 ** 2?

512. Power groups right to left, so it is 2 ** 9.

What is the difference between append and extend?

append adds its argument as one single item. extend adds each item separately.

KwickClips from this lesson

Short clips, one idea each. Good for revision the night before.

The full lesson, in text

Hello students, welcome to Kwickprep. Class twelve Computer Science builds directly on Class eleven Python. If your basics are shaky, functions and files will feel hard. Today we revise tokens, data types, operators, loops, and the four collections, fast. At the end, a quick quiz tells you which topics need a full video.

A token is the smallest meaningful unit of a program, like a word in a sentence. Keywords are reserved words, like if, for and True, and you cannot use them as names. Identifiers are names you create, and they cannot start with a digit. Literals are fixed values, such as forty five or the string Riya. Operators perform actions, like plus or double equals. Punctuators are symbols that shape the code, like brackets, the colon and the comma.

Here are the core data types, with one new term. Mutable means the value can be changed in place, after it is created. Integers and floats are numbers, and they are immutable. Complex numbers have a real and an imaginary part, written with j. Booleans are True and False. Strings and tuples are sequences that cannot be changed in place. Lists and dictionaries are mutable, so we can change them in place. And None means no value at all.

Now the operators. A single slash always gives a float, so seventeen by five is three point four. Double slash is floor division, giving three, and percent gives the remainder, two. Double star is power, and it works from right to left. So two power three power two is two power nine, which is five hundred twelve. Floor division rounds down, so minus seventeen double slash five is minus four. Not three greater than two is False.

Operator precedence decides which operator runs first. Power comes first of all, and it groups from right to left. Next comes unary minus, so minus two power two is minus four. Then multiply, divide, floor divide and remainder, from left to right. Then plus and minus. Then the comparison operators. Last come not, and, and or, in that order.

Flow of control is the order in which statements run. It can be sequential, conditional or iterative. This flowchart first reads the marks. The diamond checks if marks are thirty three or more. If yes, it prints Pass. If no, it goes down and prints Fail.

Here is conditional flow in code. Remember, one equals sign stores a value, and double equals compares. The conditions are checked from top to bottom, and the first True one wins. Sixty eight is not seventy five or more, but it is fifty or more. So it prints B, and the else is skipped.

Next, iteration with a for loop. Range of one comma eleven gives one to ten, because range stops before its end value. The remainder check picks only the even numbers. Two, four, six, eight and ten add up to thirty.

A while loop repeats as long as its condition is True. This classic program reverses a number. Percent ten takes the last digit, and floor division by ten removes it. Each turn, rev shifts left and adds that digit. So one two three four becomes four three two one. Pause and predict. What prints if num starts at zero? Zero, because the loop never runs.

Now let us compare the four collections on one screen. Strings use quotes, tuples use round brackets, lists use square brackets, and dictionaries use curly brackets. Strings and tuples are immutable, while lists and dictionaries are mutable. Strings, tuples and lists are indexed by position, but a dictionary is looked up by key. Lists allow duplicates, but dictionary keys must be unique. Changing an item of a string or tuple gives a TypeError.

Here all four collections are in action. A slice from one to four takes positions one, two and three, so the string gives Y T H. A step of minus one reverses the tuple. Index minus two of the list is the second last item, thirty. A dictionary uses a key, so the dictionary d, with the key Aman, gives seventy two. And len of a dictionary counts its key and value pairs, two.

From Class eleven, these ideas come up again and again in Class twelve papers. First, predicting output with slicing, loops and string methods like split, upper and find. Second, mutable versus immutable, and the TypeError you get when you try to change a tuple. Third, list methods, especially the difference between append and extend. Fourth, dictionary methods like get, keys, values, items and update. Fifth, the operators floor division, remainder and power, with precedence.

This one question appears very often. Append adds its argument as one single item, even if it is a whole list. So the first list becomes one, two, and a list inside, with length three. Extend adds each item separately. So the second list becomes one, two, three, four, with length four.

Now pause the video, and answer these five questions on paper. One: seven floor divide two, times two power two. Two: the slice of KWICK from one to minus one. Three: changing item zero of a tuple. Four: the length of a list holding one, and a list of two and three. Five: a dictionary with the key one given twice. Write all five answers before you play on.

Here are the answers. Seven floor divide two is three, two power two is four, so the answer is twelve. The slice drops the first and last letters, giving W I C. Changing a tuple item gives a TypeError, because tuples are immutable. The list has two items, because the inner list counts as one. A repeated key keeps only the last value, so the dictionary is one colon b.

Now count your correct answers. If all five are correct, you are ready for Class twelve topics. If you scored three or four, watch the full video only for the topics you missed. If you scored two or less, go through the full Class eleven videos first. And always write your answer before you check, because guessing in your head feels easier than an exam.

Let us revise what we covered today. The five tokens are keywords, identifiers, literals, operators and punctuators. Lists and dictionaries are mutable, while numbers, strings and tuples are not. Floor division rounds down, remainder gives what is left, and power groups from right to left. Use if elif else to decide, for with range to count, and while to repeat on a condition. And remember, append adds one item, while extend adds each item.

Courses that teach this

CourseUnit
CBSE Class 12 Computer Science (083)Computational Thinking and Programming – 2

Voice-over in this lesson is AI-generated. The script is written and checked by Kajal Ma'am. Boards can revise a syllabus mid-year, so confirm anything you plan around against the official board circular. Keep your passwords, OTPs and ID numbers to yourself — we never ask for them. To reach Kajal Ma'am, use the WhatsApp button; sharing your number there is how we call you back.

Free to watch, no sign-up. Live classes with Kajal Ma'am are the paid course; these lessons stay free either way.

Want a plan that actually fits your board dates?

Ask Kajal Ma'am directly, 20+ years teaching computer science. Free demo class first, no payment.

Talk to Kajal Ma'am on WhatsApp

Or see the Class 12 Computer Science course →

Studying outside India?

We coach CBSE, IGCSE & international students across the globe, one-to-one, in your local time zone.

Visit International →