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

KwickClips Python

Python: 204 short revision clips (page 4)

One idea per clip, with the answer written out underneath. Each clip links back to the full Python lesson it came from.

Python code with row labels 1 and 0 showing loc[0] returns 75 and iloc[0] returns 88.What is the difference between loc and iloc?42 secPython code printing a DataFrame's shape and looping with iterrows to print label and value.How do you loop over DataFrame rows?38 secA read_csv call turning a marks file into a DataFrame with named columns.What does read_csv return?44 secA saved CSV with an unnamed index column beside the same file saved with index=False.Where does the Unnamed: 0 column come from?43 secA table of read_csv options: header=None, names and index_col.What happens without header=None on a headerless file?43 secA DataFrame gaining a Total column, filtered to the toppers and saved as a new CSV.How do you add a Total column?43 secSlide comparing a table of numbers with a chart, showing a trend line and bars.Why use a chart instead of a table?40 secSlide showing three chart types side by side: line plot, bar chart and histogram.Is a bar chart the same as a histogram?41 secSlide listing Matplotlib title, xlabel, ylabel and legend on a two-line chart.How do you show which line is whose?42 secSlide explaining savefig must be called before show to avoid a blank image.Why is my saved Matplotlib image blank?40 secSlide matching data types to chart types: line, bar, histogram and pie.Which chart suits monthly rainfall?41 secPython code defining class Phone, creating objects a and b, and printing a is b as False.What is a class?41 secPython code with class Student, __init__(self, n), and print(s.name) showing Riya.What is self?40 secSlide comparing an attribute (data, no brackets) with a method (action, with brackets).Why does aman.marks have no brackets?37 secSlide comparing Python __str__ and __repr__ and when each is used.What is __str__ used for?39 secSlide describing an Account class with bal, deposit and withdraw that checks the balance.How does withdraw stop overdrawing?37 secSlide explaining a library and pip, with the command python -m pip install numpy.What is pip?40 secPython code using json.loads on a JSON string and printing marks plus 2 as 90.What does json.loads() do?39 secSlide with four checks for choosing a Python library: release, docs, users, exact name.How do you pick a good library?41 secPython code adding 5 to a numpy array of marks and printing the list and mean 65.0.How do you add 5 to every mark without a loop?39 secPython code building squares with a loop and a comprehension and printing a == b as True.Do a loop and a comprehension give the same list?43 secSlide labelling the four parts of a list comprehension: expression, for, in, if.What are the parts of a list comprehension?40 secPython nested list comprehension for seats that skips seat 2, printing A1, A3, B1, B3.In which order are the for parts written?44 secSlide listing when to use a loop instead of a list comprehension.When should you use a loop instead?41 secPython code calling a lambda that squares 6 and printing 36.What does anonymous mean?42 secPython code with add = lambda a, b: a + b printing 65.Why does return inside a lambda give a syntax error?41 secSlide showing lambda used with sorted, map and filter on student marks.What does the lambda do in filter()?39 secSlide listing when to choose def instead of lambda in Python.When should you use def instead of lambda?41 secAnimated call stack showing fact(3), fact(2) and fact(1) frames stacking and returning.How does Python track a function calling itself?39 secPython factorial function with base case and recursive case, printing fact(4) as 24.Why did my recursion never stop?38 secSlide comparing base and recursive cases for factorial, Fibonacci and digit sum.What is the base case for sum of digits?40 secSlide on recursion depth limit of 1000 and the number of calls made by fib(20).What is Python's typical recursion limit?41 secPython code with class Vehicle and child Bike calling go and printing Go.How does a child class inherit?38 secSlide explaining a child __init__ overriding the parent and calling super().__init__ to fix it.Why is the name missing in my child class?42 secPython code with Ticket and child Kid both defining fare; output 50.What is overriding?39 secPython code with Person, Student and Monitor classes; Monitor().go() prints Go.What is multilevel inheritance?39 secSlide explaining public names, one underscore and two underscores in Python.What does one underscore mean?39 secPython code with @property marks returning 88, printed with no brackets.What does @property do?40 secPython code looping over Bus and Cab objects and calling pay, printing 20 and 250.What is polymorphism?40 secPython code where a Robot class with quack is passed to listen, printing Beep quack.What does Python check in duck typing?40 secA marks table showing NaN where a mark is missing, beside a real zero.What does NaN stand for?41 secisnull marking missing cells True beside notnull marking present cells True.Why can't you use == to find NaN?45 secA table showing dropna removing rows and fillna replacing gaps with 0 or the mean.What does dropna() remove?43 secA decision table matching how much data is missing to dropping rows, dropping a column, or filling.When should you drop a whole column?43 secFour things scikit-learn provides: datasets, models, a split function and metrics.What do you install and what do you import?44 secData split into a training portion the model learns from and a hidden test portion.Why keep a test set hidden?41 secCode calling fit on training data, predict on test features and score for accuracy.Which method makes the model learn?42 secThree questions to ask about a model score, with a per-species table of where the mistakes were.What does random guessing give with three species?40 sec

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 →