0% found this document useful (0 votes)
8 views2 pages

Python Unit Test: Key Definitions & Examples

Uploaded by

playconsolerutuj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Python Unit Test: Key Definitions & Examples

Uploaded by

playconsolerutuj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python Unit Test - 2 | Short Notes & Bonus

Definitions
Bonus Quick Definitions (for extra marks)

Term Definition / Example


List A list is an ordered, mutable collection of elements. Example: <font face='Courier'>[1, 2, 3]</fo
Tuple A tuple is an ordered, immutable collection of elements. Example: <font face='Courier'>(1, 2, 3
Dictionary A dictionary stores data as key-value pairs. Example: <font face='Courier'>{'name': 'Raj', 'age'
Set A set is an unordered collection of unique elements. Example: <font face='Courier'>{1, 2, 3}</
Lambda Function A small anonymous function written using the <b>lambda</b> keyword. Example: <font face=
Loop Used to repeat a block of code multiple times. Example: <font face='Courier'>for i in range(5):
Conditional Statement Used to make decisions. Example: <font face='Courier'>if a > b: print('A is greater')</font>
Class A blueprint for creating objects with attributes and methods. Example: <font face='Courier'>cla
Object An instance of a class containing real data.
Function A reusable block of code that performs a specific task. Example: <font face='Courier'>def add

You might also like