Computer Science cheat sheet
11 chapters. In each, the formulas come first, then the key facts. The number beside a line is the NCERT page it is printed on.
11 chapters · 19 formulas · 455 key facts
- 1Start hereComputer SystemComputer Science · 10 formulas · 41 key factsRead
- 2Encoding Schemes and Number SystemComputer Science · 6 formulas · 41 key factsRead
- 3Emerging TrendsComputer Science · 36 key factsRead
- 4Introduction to Problem SolvingComputer Science · 42 key factsRead
- 5Getting Started with PythonComputer Science · 37 key factsRead
- 6Flow of ControlComputer Science · 44 key factsRead
- 7FunctionsComputer Science · 43 key factsRead
- 8StringsComputer Science · 3 formulas · 43 key factsRead
- 9ListsComputer Science · 42 key factsRead
- 10Tuples and DictionariesComputer Science · 44 key factsRead
- 11Societal ImpactComputer Science · 42 key factsRead
Computer System
8 topics · 10 formulas · 41 facts
- 1Introduction to Computer System
- 2Evolution of Computer
- 3Computer Memory
- 4Data Transfer between Memory and CPU
- 5Microprocessors
- 6Data and Information
- 7Software
- 8Operating System
- Nibblep.5
- Bytep.5
- Kilobyte (KB)p.6
- Megabyte (MB)p.6
- Gigabyte (GB)p.6
- Terabyte (TB)p.6
- Petabyte (PB)p.6
- Exabyte (EB)p.6
- Zettabyte (ZB)p.6
- Yottabyte (YB)p.6
A computer system primarily comprises a central processing unit (CPU), memory, input/output devices, and storage devices functioning together as a single unit.
p.1The central processing unit is the electronic circuitry of a computer that carries out data processing and is placed on integrated circuits made of semiconductor materials.
p.1Registers are high-speed local memory units located directly on the CPU chip used to temporarily hold instructions, data, and intermediate results during processing.
p.2The Control Unit (CU) interprets instructions, controls sequential instruction execution, and guides data flow through memory, ALU, and input or output devices.
p.2Input devices convert incoming data into digital form acceptable to the computer, temporarily storing it in primary memory (RAM) for processing.
p.2Output devices convert digital information from the computer system into human-understandable visual, audio, or physical form.
p.2Charles Babbage designed the Analytical Engine in 1834 as a mechanical computing device for inputting, processing, storing, and displaying output, forming the basis of modern computers.
p.3John Von Neumann introduced the stored-program computer concept in 1945 where both data and programs are stored together in the same memory.
p.3The Von Neumann architecture consists of a CPU for processing instructions, a memory for data and programs, input/output devices, and communication channels.
p.4Moore’s Law predicted that the number of transistors that could be assembled in a single microchip would double every two years while the costs would be halved.
p.4Large Scale Integration (LSI) in the 1970s enabled the integration of an entire CPU on a single microchip, creating the microprocessor.
p.4The basic unit of computer memory is the bit (binary digit 0 or 1), where four bits make a nibble and eight bits make a byte.
p.5Primary memory interacts directly with the CPU for read and write operations and is divided into volatile RAM and non-volatile ROM.
p.6RAM is volatile memory that temporarily stores data and programs during operation, losing its contents as soon as power is turned off.
p.6ROM is non-volatile memory that retains its contents without power, permanently storing critical startup routines like the boot loader.
p.6Cache memory is a very high-speed memory placed between the CPU and primary memory to store frequently accessed data and minimize memory access latency.
p.6When the CPU requires data, it first checks cache memory; if found, it is read from cache, and only otherwise is primary memory accessed.
p.7Secondary memory cannot be accessed directly by the CPU, so its contents must first be transferred into main memory for processing.
p.7Data are transferred between different components of a computer system using physical communication channels called buses.
p.7The system bus consists of a data bus to transfer data, an address bus to specify memory locations, and a control bus to communicate control signals.
p.7A CPU implemented entirely on a single microchip is called a microprocessor, built on an integrated circuit comprising millions of transistors, resistors, and diodes.
p.8The data bus is bidirectional because the CPU reads and writes data, whereas the address bus and control bus are unidirectional.
p.8A dedicated hardware component called the memory controller manages and coordinates the flow of data into and out of the computer’s main memory.
p.8Word size is the maximum number of bits that a microprocessor can process at a time, ranging from 16 bits to 64 bits in modern processors.
p.9Clock speed indicates the number of pulses generated per second by the internal clock, determining the speed at which instructions are executed.
p.9Raw and unorganised facts provided to a computer system constitute data, which is processed to generate meaningful information.
p.10Structured data follows a strict record structure organized in pre-specified tabular rows and columns that can easily be sorted and queried.
p.11Semi-structured data lacks a rigid tabular structure but maintains internal tags or markers to separate data elements, as seen in HTML and CSV files.
p.12Unstructured data does not follow any pre-defined record format, including multimedia files such as audio, video, graphics, and text documents.
p.12Data retrieval involves fetching stored digital data from storage devices or databases for processing according to user requirements.
p.13Software comprises the set of instructions and data that operates computer hardware to complete desired computational tasks.
p.14Software acts as an interface between human users and computer hardware, broadly categorized into system software, programming tools, and application software.
p.15A device driver acts as a mediator between an attached peripheral device and the operating system, handling hardware-level device operations.
p.16A compiler translates entire high-level source code into machine code at once, whereas an interpreter translates and executes code line by line.
p.18Free and Open Source Software (FOSS) provides users with the executable software as well as full access to the source code to modify and improve.
p.19The operating system functions as a resource manager that supervises hardware resources including CPU, RAM, and I/O devices while supporting application execution.
p.20A command-based interface requires users to enter textual commands using a keyboard and typically executes only a single program at a time, as in MS-DOS.
p.21A Graphical User Interface (GUI) enables users to run programs and give instructions using visual elements such as icons, menus, and windows.
p.21Process management in an operating system schedules active processes, allocates CPU time among them, and manages inter-process communication.
p.22Memory management dynamically allocates and reclaims main memory space for running processes while tracking free and occupied memory locations.
p.22File management handles the creation, updating, deletion, and access protection of files stored in secondary memory to prevent unauthorized access.
p.23
Encoding Schemes and Number System
2 topics · 6 formulas · 41 facts
- 1Number System
- 2Conversion between Number Systems
- Number of characters in 7-bit ASCIIp.28
- Number of characters in 8-bit ISCIIp.29
- Octal base as power of twop.33
- Four-bit representation for hexadecimal symbolsp.33
- Three-bit binary combinations for octalp.38
- Hexadecimal base as power of twop.39
When a keyboard key is pressed, it is internally mapped to a unique code value which is then converted into binary digits for the computer to understand.
p.27Encoding is the mechanism of converting human-recognisable data into an equivalent cipher using a specific code.
p.27ASCII was developed in the early 1960s to standardise character representation across different computer systems.
p.28Standard 7-bit ASCII uses 7 bits to represent up to 128 unique characters and can encode only the character set of the English language.
p.28In the ASCII code table, printable characters begin with Space at decimal value 32, uppercase letter A at decimal value 65, and lowercase letter a at decimal value 97.
p.28ISCII is an 8-bit encoding scheme developed in India during the mid-1980s to facilitate the use of Indian languages on computers, representing up to 256 characters.
p.29ISCII retains all 128 ASCII codes and assigns the remaining 128 codes, specifically the upper region 160 to 255, to the aksharas of Indian languages.
p.29UNICODE was developed to incorporate all characters of every written language of the world by providing a unique number for every character across all devices, operating systems, and applications.
p.29Commonly used UNICODE encodings are UTF-8, UTF-16, and UTF-32, which form a superset of ASCII where code values 0 to 128 represent the same characters as in ASCII.
p.30Every number system has a set of unique characters or literals, whose total count is called the radix or base of the number system.
p.30In a positional number system, the symbol at the rightmost position in the integer part has position 0, and position values increase from right to left by 1.
p.31In the fractional part of a positional number, the first symbol has position number -1, which decreases by 1 while reading from left to right.
p.31The positional value of each symbol in a number is computed by raising the base value of the number system to the power of that symbol position number.
p.31The decimal number system is a base-10 system using digits 0 to 9, where a number is represented by both symbol values and power-of-10 positional values.
p.32The binary number system is a base-2 system using digits 0 and 1, representing the OFF/low and ON/high electronic states of transistors in integrated circuits.
p.32The octal number system is a base-8 system comprising eight digits from 0 to 7, devised to provide a compact representation for large binary numbers.
p.32Three binary digits are sufficient to represent any octal digit because 2 raised to the power 3 equals 8.
p.33The hexadecimal number system is a base-16 system consisting of 16 symbols, where digits 0 to 9 represent decimal 0 to 9 and letters A to F represent decimal 10 to 15.
p.33Each alphanumeric digit in the hexadecimal system is represented as a group of 4 binary digits because 2 raised to the power 4 equals 16.
p.33Hexadecimal and octal notations are used to simplify 16-bit or 32-bit computer memory address representations, making them easier to handle than long binary strings.
p.34RGB colour codes on web pages use 24 bits with 8 bits each for red, green, and blue, representing a palette of 16 million colours compactly written in hexadecimal form.
p.34Digital systems understand only binary numbers, whereas octal and hexadecimal number systems are used to simplify binary representations for humans.
p.34To convert a decimal number to another number system with base b, repeatedly divide the quotient by b and record the remainders until the quotient is zero.
p.35The equivalent number in the target base is obtained by collecting the noted division remainders in reverse order, from bottom to top.
p.35Decimal to octal conversion is performed by repeatedly dividing the decimal number by 8 and collecting the remainders from bottom to top.
p.36Decimal to hexadecimal conversion involves repeatedly dividing the decimal number by 16, replacing remainders 10 through 15 with symbols A through F, and reading from bottom to top.
p.36To convert any number with base b to decimal, multiply each symbol by base b raised to its position number and compute the sum of all terms.
p.37A binary number is converted to decimal by adding the products of each binary digit and its corresponding power of 2 positional value.
p.38An octal number is converted to decimal by multiplying each octal digit by 8 raised to its position number and summing the products.
p.38A hexadecimal number is converted to decimal by multiplying each digit or letter value by 16 raised to its position number and adding the results.
p.38An integer binary number is converted to octal by partitioning bits into 3-bit groups from right to left and replacing each group with its octal digit.
p.39If the number of bits in a binary number is not a multiple of 3, required zeros are added to the most significant position before grouping for octal conversion.
p.39An octal number is converted to binary by substituting each octal digit with its equivalent 3-digit binary number and concatenating them.
p.39An integer binary number is converted to hexadecimal by forming 4-bit groups from right to left and substituting each group with its hexadecimal symbol.
p.39A hexadecimal number is converted to binary by substituting each hexadecimal symbol with its equivalent 4-bit binary group and combining them.
p.40To convert a decimal fraction to another base b, repeatedly multiply the fractional part by b, recording the integer part of each product from top to bottom.
p.40Successive multiplication of a decimal fractional part terminates when the fractional part reaches zero, starts repeating, or attains required precision.
p.40In converting fractional decimal numbers to another base, the integer parts obtained from successive multiplications are arranged from top to bottom.
p.41A non-decimal number with a fractional part is converted to decimal by adding products of digits and their positional values with negative powers of the base.
p.42To convert a fractional binary number to octal or hexadecimal, form 3-bit or 4-bit groups from right to left for the integer part and from left to right for the fractional part.
p.42Zeros are appended to the right of the fractional part of a binary number if needed to form a complete 3-bit or 4-bit group during conversion.
p.42
Emerging Trends
6 topics · 36 facts
- 1Artificial Intelligence (AI)
- 2Big Data
- 3Internet of Things (IoT)
- 4Cloud Computing
- 5Grid Computing
- 6Blockchains
Artificial Intelligence endeavours to simulate human intelligence into machines so that they can perform cognitive functions such as learning, decision-making, and problem solving with minimum human intervention.
p.45A knowledge base in an artificial intelligence system is a store of information consisting of facts, assumptions, and rules used by the machine for decision making.
p.46Machine learning is a subsystem of artificial intelligence where algorithms learn from training data using statistical techniques without being explicitly programmed by humans.
p.46Natural Language Processing enables computers to interact with humans using spoken languages and performs both text-to-speech and speech-to-text conversions.
p.46Virtual Reality creates a three-dimensional computer-generated simulation of the real world that fully immerses the user using VR headsets and multi-sensory stimulation.
p.47Augmented Reality superimposes computer-generated digital components onto the physical surroundings without creating a new environment, thereby augmenting real-world perception.
p.47A robot is a computer-programmable machine that uses sensors and mechanical assemblies to carry out repetitive or complex tasks automatically with accuracy and precision.
p.48A drone is an unmanned aircraft that flies autonomously or via remote control using software-controlled flight plans, embedded systems, onboard sensors, and GPS.
p.48Big Data refers to datasets of enormous volume and complexity generated at colossal rates that cannot be processed or analysed using traditional DBMS tools.
p.49Unstructured data such as posts, chats, photographs, tweets, and audio-video streams comprise a major portion of the 2.5 quintillion bytes of data generated each day.
p.49The five characteristics that distinguish Big Data from traditional datasets are Volume, Velocity, Variety, Veracity, and Value.
p.50Variety indicates that Big Data includes structured, semi-structured, and unstructured formats, whereas Veracity refers to the trustworthiness and reliability of the data.
p.50Data analytics is the process of examining datasets using specialised systems and software to draw conclusions, verify scientific hypotheses, and make informed business decisions.
p.50Pandas is an open-source Python library that provides high-performance data structures and tools to make data analysis substantially simpler.
p.50The Internet of Things is a network of physical devices embedded with electronics, microcontrollers, and software that allows them to interact and exchange data across a network.
p.51Web of Things extends IoT by using web services to integrate physical devices into the web, allowing multiple heterogeneous devices to communicate through a unified web interface.
p.51In mobile devices, an accelerometer detects the screen's physical orientation, whereas a gyroscope tracks angular rotation and twisting motions.
p.52A smart sensor captures physical environmental input, executes predefined functions using built-in computing resources, and processes data before transmitting it.
p.52Smart cities deploy IoT networks and sensor nodes to monitor structural safety, optimize traffic and water networks, and automate municipal resource distribution.
p.52Cloud computing delivers on-demand computing services including servers, databases, software, and storage over the Internet on a pay-per-use utility model.
p.53The three standard delivery models for cloud computing services are Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS).
p.54Infrastructure as a Service delivers off-site virtual machines, servers, storage, and networking hardware that users can rent on demand to deploy and manage custom software stacks.
p.54Platform as a Service provides a pre-configured platform allowing developers to create, test, and deploy applications without managing the underlying server infrastructure or runtime environment.
p.54Software as a Service provides end-users with subscription-based access to application software hosted centrally in the cloud without requiring local installation or hardware maintenance.
p.55MeghRaj is the Government of India initiative known as GI Cloud designed to harness cloud computing benefits for public administration and digital governance.
p.55A computing grid is a network of geographically dispersed and heterogeneous computational nodes that temporarily pool their processing power and storage to solve a common complex task.
p.55While cloud computing focuses on providing on-demand utility services, grid computing combines dispersed hardware resources to act as a virtual supercomputer for specific applications.
p.55A Data Grid manages large distributed data requiring multi-user access, whereas a CPU or Processor Grid partitions large computational jobs into subtasks executed in parallel across nodes.
p.56Unlike IaaS where a commercial provider rents infrastructure to clients, grid computing pools shared resources from multiple participating nodes to solve intensive scientific problems.
p.56The open-source Globus Toolkit provides the essential middleware required to manage distributed resources, handle security, and coordinate communications across grid nodes.
p.56Blockchain technology operates on a decentralized, shared database where every participating computer node maintains a full local copy of the transactional database.
p.56In a blockchain, each block consists of public header information visible to every node in the network and protected private data accessible exclusively to its owner.
p.56A blockchain functions as an append-only distributed ledger that is updated only when a proposed transaction block is authenticated by consensus across network nodes.
p.57Data security and immutability in a blockchain are guaranteed because tampering with records is impossible unless the alterations are validated across all distributed copies.
p.57Beyond cryptocurrency, blockchain technology is applied to prevent disputes and fraud in land registration records, healthcare data sharing, and transparent voting systems.
p.57Blockchain ensures operational transparency, accountability, and fraud prevention across diverse industries including banking, media, telecommunications, and governance.
p.58
Introduction to Problem Solving
8 topics · 42 facts
- 1Steps for Problem Solving
- 2Algorithm
- 3Representation of Algorithms
- 4Flow of Control
- 5Verifying Algorithms
- 6Comparison of Algorithm
- 7Coding
- 8Decomposition
Problem solving using a computer begins with the precise identification of the problem and concludes with a complete working software solution.
p.62The GIGO principle (Garbage In, Garbage Out) states that the correctness of the output produced by a computer directly depends on the correctness of the input provided.
p.62Analysing a problem requires determining the core functionalities of the solution and identifying the required inputs and expected outputs.
p.62An algorithm is a set of exact, step-by-step instructions devised in natural language to accomplish a task before programming begins.
p.62Coding converts the finalised algorithm into a computer-readable program using a high-level programming language.
p.63In the presence of syntactical errors, no program output is generated, whereas incorrect output signals the presence of logical errors in the program.
p.63Standard software development methodologies employ unit testing, integration testing, system testing, and acceptance testing to systematically verify and debug applications.
p.63An algorithm is a finite sequence of steps required to achieve the desired output in a finite amount of time, having a definite beginning and end.
p.64The term algorithm originates from the Latin translation Algorithmi of the 9th-century Persian astronomer and mathematician Abu Abdullah Muhammad ibn Musa Al-Khwarizmi.
p.64A programmer prepares an algorithm as a roadmap before writing code to clearly visualise instructions and avoid developing non-functional software.
p.64A good algorithm must exhibit precision in its steps, uniqueness of each step result, finiteness to terminate after finite steps, and well-defined input and output.
p.65Flowcharts and pseudocode are the two common methods for representing algorithms, showcasing solution logic without including implementation details.
p.66In a flowchart, an oval terminator represents start or end, a rectangle represents a process, a diamond represents a decision branch, and a parallelogram represents data input or output.
p.66Flowchart arrows act as connectors that explicitly indicate the sequence of operations and direction of flow of control between shapes.
p.66Pseudocode is an informal, human-readable algorithmic notation that cannot be executed directly by a computer and has no rigid standard syntax.
p.68Standard pseudocode keywords frequently include INPUT, COMPUTE, PRINT, INCREMENT, DECREMENT, IF/ELSE, and WHILE.
p.68Writing pseudocode safeguards the programmer against omitting essential steps and allows non-programmers to review and verify proposed program logic.
p.69Flow of control represents the execution sequence of program events, which can proceed in a linear sequence, branch upon selection, or iterate via repetition.
p.70In a sequence control structure, algorithm steps execute strictly one after another without branching or conditional jumps.
p.70Selection structures rely on conditionals evaluating to binary values of true or false to choose among alternative paths of action.
p.71In programming languages, two-way conditional selection is represented using an if-else block, executing the else branch whenever the tested condition evaluates to false.
p.72Repetition, also termed iteration or looping, executes a block of statements repeatedly until a specified condition is satisfied.
p.75A loop counter variable tracks the number of executed iterations and increments until it reaches the repetition limit specified in the loop condition.
p.75The WHILE construct handles iterative tasks when the required number of repetitions is not known beforehand and depends on dynamic input values.
p.76Algorithm verification ensures that every component is checked and verified across all possible situations to prevent fatal software failures.
p.77A dry run is the manual simulation of an algorithm using sample input values to uncover missing details and detect incorrect steps.
p.77Testing an algorithm requires selecting representative input cases including boundary values, as untested scenarios can cause software to fail.
p.77Algorithm simulation on varied test cases reveals constraints such as boundary conditions, allowing logic adjustments before coding.
p.78Verifying an algorithm prior to software development is essential because the effort required to identify and fix flaws in an algorithm is minimal compared to debugging implemented software.
p.79Multiple distinct algorithms can exist to solve the same computational problem, necessitating comparison to determine the most efficient approach.
p.79Time complexity is the amount of processing time an algorithm requires to run to completion.
p.80Space complexity is the amount of computer memory an algorithm requires during its execution.
p.80Choosing an optimal algorithm involves evaluating trade-offs between processing time requirements (time complexity) and memory consumption (space complexity).
p.80In prime number testing, checking divisors up to the square root of the dividend significantly reduces computational operations compared to testing all numbers up to the dividend.
p.80Coding is the step of translating a finalised algorithm into a high-level programming language according to its established syntax rules.
p.80Syntax is the formal grammatical rules governing statement formulation in a programming language, specifying spelling, word order, and punctuation.
p.80Low-level machine language consisting of 0s and 1s executes directly on hardware without translation, but is machine-dependent and difficult for humans to write and maintain.
p.80High-level programming languages are close to natural languages and portable across different computing platforms, requiring compilers or interpreters to translate source code into machine language.
p.81Embedded systems such as digital watches, traffic signals, and smart medical devices often require specialised programming tools or assembly language code.
p.81Decomposition is the problem-solving strategy of breaking down a complex problem into smaller, simpler, and relatively manageable sub-problems.
p.81Decomposition follows the divide-and-conquer principle, enabling sub-problems to be examined in detail and developed independently by specialized teams.
p.82Once decomposed sub-problems are independently solved, each component must be verified for correctness before integrating them into the final comprehensive solution.
p.82
Getting Started with Python
12 topics · 37 facts
- 1Introduction to Python
- 2Python Keywords and Identifiers
- 3Variables
- 4Comments
- 5Everything is an Object
- 6Data Types
- 7Operators
- 8Expressions
- 9Statement
- 10Input and Output
- 11Type Conversion
- 12Debugging
Python uses an interpreter to process program statements one by one by first translating and then executing, stopping execution if an error is encountered.
p.87Python is a case-sensitive high-level language that uses indentation instead of curly brackets or keywords to define blocks and nested blocks of code.
p.88In script mode, Python instructions are written and saved in a file with a .py extension for future execution, whereas interactive mode executes statements instantaneously without saving.
p.89Python keywords are reserved words that carry a specific meaning for the interpreter and must be written exactly in lowercase, except True, False, and None.
p.90An identifier must begin with an uppercase or lowercase letter or an underscore, cannot start with a digit, and cannot contain special symbols or keywords.
p.91A variable in Python refers to an object stored in memory and is created and assigned a value using an assignment statement.
p.91Variable declaration is implicit in Python, meaning variables are automatically declared upon their first assignment and must be assigned a value before use in expressions.
p.92Comments are non-executable remarks added to source code to document the purpose and input-output requirements of a program for human programmers.
p.92In Python, a comment starts with a hash sign (#), and everything following the hash symbol until the end of that line is ignored by the interpreter.
p.93Python treats every value or data item as an object that can be bound to a variable name or passed to a function as an argument.
p.93Every Python object is assigned a unique identifier corresponding to its memory address that remains constant for its lifetime, retrieved using the id() function.
p.93Boolean (bool) is a subtype of integer consisting of True and False, where True is non-zero, non-null, and non-empty, while False is zero.
p.94A Python sequence is an ordered collection of items indexed by integers, encompassing strings, lists, and tuples.
p.95Lists are mutable ordered sequences enclosed in square brackets, whereas tuples are immutable sequences enclosed in parentheses whose elements cannot be changed once created.
p.96A set is an unordered collection of unique elements enclosed in curly brackets that cannot contain duplicate values and whose elements cannot be modified once created.
p.96None is a special data type with a single value used to signify the absence of a value, and it is distinct from both False and numeric zero.
p.97A dictionary is a mapping data type that stores unordered key-value pairs in curly brackets, where each key is separated from its value by a colon for fast lookup.
p.97Mutable data types like lists, sets, and dictionaries allow modifying their values in place, whereas immutable types like numbers, strings, and tuples cannot be modified once created.
p.98The floor division operator // returns the quotient by truncating the decimal part, whereas the modulus operator % returns the remainder of dividing the left operand by the right.
p.100The addition operator + concatenates two strings, while the multiplication operator * repeats a string by a specified integer count.
p.100Relational operators compare values on either side and return True or False, comparing string characters lexicographically using their ASCII values.
p.101Augmented assignment operators like += and -= combine an arithmetic operation with assignment such that x += y behaves identically to x = x + y.
p.102Logical operators and, or, and not evaluate truth values where every operand is considered True except None, False, numeric zero, and empty sequences or collections.
p.103The identity operator is returns True if two operands refer to the exact same memory object, whereas the membership operator in tests whether an element exists in a sequence.
p.104An expression is a combination of constants, variables, and operators that always evaluates to a single value, whereas a standalone operator cannot form an expression.
p.104Unary operators have higher precedence than binary operators, and the exponentiation operator ** has the highest precedence among all arithmetic operators.
p.105Parentheses override standard operator precedence, and operators sharing the same precedence level are evaluated from left to right.
p.105In Python, a statement is an executable unit of code processed by the interpreter, including assignment statements and print statements.
p.106The input() function optionally displays a prompt string, accepts all user keyboard input terminated by the enter key, and always returns the input as a string.
p.107The print() function evaluates expressions before displaying them on the screen and automatically appends a newline by default to advance to the next line.
p.107In the print() function, the sep argument defines the separator between values with a default single space, and end specifies the trailing string with a default newline character.
p.108Explicit type conversion, or type casting, occurs when a programmer forces a type change using functions like int() or float(), which risks information loss by discarding decimal digits.
p.109Python does not implicitly convert integers to strings during concatenation with the plus operator, raising a TypeError unless the integer is explicitly converted via str().
p.111Implicit type conversion, or coercion, is performed automatically by Python through type promotion, converting narrower data types to wider-sized types to avoid information loss.
p.112Debugging is the process of identifying and removing bugs or errors from a computer program to ensure it runs correctly and produces expected results.
p.112Syntax errors violate language grammar rules and stop execution immediately, whereas logical or semantic errors allow the program to run to completion but yield incorrect output.
p.113Runtime errors occur during program execution when a syntactically correct statement attempts an illegal operation such as division by zero, causing abnormal termination.
p.113
Flow of Control
5 topics · 44 facts
- 1Selection
- 2Indentation
- 3Repetition
- 4Break and Continue Statement
- 5Nested Loops
The order of execution of statements in a program is known as flow of control, which Python implements using two types of control structures: selection and repetition.
p.121In programming, selection or decision making involves choosing from two or more possible options based on a condition, and is implemented in Python using if statements.
p.122In an if statement, the indented block of statements is executed only if the test condition evaluates to true; otherwise, execution is bypassed.
p.123There is no limit on the number of statements that can appear as an indented block under an if statement.
p.123The if..else statement provides two alternative execution paths, executing the if block when the condition is true and the else block when the condition is false.
p.123When multiple conditions must be checked, conditions can be chained sequentially using the if..elif construct, where elif stands for else..if.
p.123The syntax of a multi-way selection structure uses if followed by one or more elif statements and concludes with an optional else block.
p.124In an if..elif ladder, conditions are evaluated sequentially from top to bottom; as soon as one condition evaluates to true, its indented block executes and the if statement terminates.
p.125The number of elif clauses in a selection structure is dependent on the number of alternative conditions to be evaluated.
p.125Python uses indentation rather than curly brackets to define blocks and nested block structures.
p.126Leading whitespace consisting of spaces and tabs at the beginning of a statement is called indentation.
p.126In Python, statements sharing the same level of indentation are grouped together into a single block of code.
p.126The Python interpreter strictly checks indentation levels and raises a syntax error if indentation is improper or inconsistent.
p.126It is a common programming practice in Python to use a single tab or consistent whitespace for each level of indentation.
p.126Repetition of a set of statements in a program is called iteration and is implemented using looping constructs.
p.127Statements in a loop execute repeatedly as long as a logical condition tested on the loop's control variable remains true.
p.128When the loop control condition evaluates to false, the loop terminates and control transfers to the statement immediately following the loop.
p.128The programmer must ensure that the loop condition eventually becomes false to provide an exit condition and avoid an infinite loop.
p.128Python provides two looping constructs: the for loop, used when the number of iterations is known in advance, and the while loop.
p.128The for statement is used to iterate over a range of values or elements of a sequence such as a string, list, or tuple.
p.128The syntax of a for loop is 'for <control-variable> in <sequence/items in range>:' followed by an indented body of statements.
p.128In each iteration of a for loop, the control variable is assigned the next item from the sequence until all items are exhausted.
p.129The built-in range([start], stop[, step]) function generates a sequence of integers from start up to, but excluding, the stop value.
p.130In the range() function, start and step are optional parameters that default to 0 and 1, respectively.
p.130All parameters of the range() function must be integers, and passing non-integer values causes a TypeError.
p.130The step parameter of range() can be a positive or negative integer, but it cannot be zero, which raises a ValueError.
p.130A negative step parameter in range() generates a decreasing sequence of integers where start must be greater than stop.
p.130The while statement executes its body of code repeatedly as long as its control condition evaluates to true.
p.131In a while loop, the control condition is evaluated before any statement in the loop body is executed.
p.131If the test condition of a while loop is initially false, the body of the loop is not executed even once.
p.131Statements within the body of a while loop must update the control variable so that the loop condition eventually evaluates to false.
p.131The break and continue statements in Python provide programmer flexibility to alter the normal execution flow of loops.
p.132The break statement terminates the current loop immediately and resumes execution at the statement directly following that loop.
p.133When a break statement is executed inside a loop, all remaining statements in the loop body for that iteration are skipped.
p.133A 'while True:' loop executes indefinitely until an internal condition triggers a break statement to exit the loop.
p.134In search algorithms or prime-testing routines, executing break terminates the loop as soon as a target is found, avoiding redundant checks.
p.134When continue is encountered, control skips the remaining statements in the loop body for the current iteration and jumps to the next iteration.
p.135After continue executes, if the loop condition remains true, the next iteration begins; otherwise, the loop terminates.
p.135A loop contained inside another loop is called a nested loop.
p.136In nested loops, for each single iteration of the outer loop, the inner loop executes through all its iterations from beginning to end.
p.136Python does not impose any restriction on how many loops can be nested inside a loop or on the levels of nesting.
p.137Any type of loop, whether for or while, can be freely nested within any other type of loop.
p.137Loops can be nested inside conditional blocks such as if-else ladders, and conditional statements can be nested inside loop bodies.
p.138When a break statement is executed inside an inner nested loop, it terminates only that inner loop, and execution resumes in the outer loop.
p.138
Functions
4 topics · 43 facts
- 1Functions
- 2User Defined Functions
- 3Scope of a Variable
- 4Python Standard Library
Modular programming is the process of dividing a computer program into separate independent blocks of code or sub-problems with distinct names and specific functionalities.
p.145A function is a named group of instructions that accomplishes a specific task when invoked, providing program modularity and code reusability.
p.145Once defined, a function can be called repeatedly from different locations in a program or from inside another function by specifying its name and passing required arguments.
p.145Using functions reduces overall code length and simplifies debugging by eliminating the need to write identical blocks of code at multiple places in a program.
p.146Functions facilitate collaborative programming by allowing complex projects to be divided into independent modules that team members can develop in parallel.
p.146A user-defined function is a custom function written by a programmer to accomplish a specific task according to program requirements.
p.146A function definition begins with the def keyword, followed by the function name and optional parameters enclosed in parentheses, ending with a colon.
p.147Function names must follow the standard rules for naming Python identifiers and should be unique within their scope.
p.147Statements belonging to a function body must be indented uniformly under the function header, and unindented statements are treated as outside the function.
p.147A function is executed by calling it using its name followed by parentheses containing any required arguments.
p.148An argument is a value or expression passed during a function call, which is received by the corresponding parameter variable defined in the function header.
p.148At the time of a function call, the argument and its corresponding parameter initially refer to the same object in memory, sharing the same identity returned by id().
p.149When an immutable argument such as an integer is modified inside a function, Python binds the parameter to a new memory address while the original caller variable remains unchanged.
p.149An argument variable in the calling scope and a parameter in the function header can share the same identifier name without conflict.
p.150A default parameter is assigned a predefined fallback value in the function header, which is used when the caller omits the corresponding argument.
p.152Passing an explicit argument during a function call overwrites the default parameter value defined in the function header.
p.153Default parameters must be trailing parameters in the function header, meaning every parameter to the right of a parameter with a default value must also have a default value.
p.153Function arguments can be expressions, which Python evaluates to compute a concrete value before passing it to the function.
p.153A function that performs calculations or displays output without returning an explicit value is called a void function, and it implicitly returns None.
p.154The return statement immediately terminates execution of a called function, transfers control back to the caller, and optionally passes back a result.
p.154Statements inside a function definition are executed only when the function is invoked, rather than when the interpreter encounters the def statement.
p.155A function must be defined before it is called in the flow of execution, otherwise the Python interpreter raises a NameError.
p.155When a function returns multiple comma-separated values, Python packages them into a single tuple that can be unpacked into individual variables by the caller.
p.156The scope of a variable is the region of a computer program where that variable is recognized, accessible, and valid.
p.158A global variable is defined outside all functions or blocks, is accessible throughout the program, and modifications to it affect all functions that reference it.
p.158A local variable is defined inside a function or block, is accessible only within that specific function or block, and exists only while the function is executing.
p.158If a variable defined inside a function shares the same name as a global variable, the local variable hides the global variable within that function scope.
p.159To modify the value of a global variable from inside a function, the variable must be declared inside the function using the global keyword.
p.159The Python Standard Library is an extensive collection of built-in functions and modules that facilitates rapid program development.
p.160Built-in functions are ready-made functions built directly into the Python interpreter that can be called without importing any external module.
p.160The built-in divmod(x, y) function takes two numeric arguments and returns a tuple containing their quotient and remainder: (x // y, x % y).
p.161The built-in pow(x, y, z) function computes x raised to the power y modulo z, which evaluates to (x**y) % z.
p.162The built-in sum(x, num) function returns the sum of all elements in numeric sequence x added to the optional starting value num, which defaults to 0.
p.162A module is a Python file with a .py extension that contains definitions of multiple related functions and statements.
p.162When a module is loaded via import modulename, its functions must be accessed using dot notation in the format modulename.functionname().
p.163In the math module, math.ceil(x) returns the smallest integer greater than or equal to x, whereas math.floor(x) returns the largest integer less than or equal to x.
p.163The random.random() function takes no arguments and returns a pseudo-random floating-point number in the range from 0.0 up to, but not including, 1.0.
p.164The random.randint(x, y) function generates a random integer N such that x <= N <= y, including both endpoint integers.
p.165The random.randrange(x, y) function generates a random integer from start value x up to, but excluding, stop value y.
p.165Regardless of how many times an import statement is executed in a program, the Python interpreter loads the specified module into memory only once.
p.165The from modulename import functionname statement imports specific functions into the current namespace, allowing them to be called directly without the module name prefix.
p.166Function composition is a programming technique where functions are nested so that the output of one function serves as the argument to another function.
p.167A docstring is a multiline string enclosed in triple quotes at the start of a module or function that documents its behavior, accessible via the __doc__ attribute.
p.168
Strings
5 topics · 3 formulas · 43 facts
- 1Strings
- 2String Operations
- 3Traversing a String
- 4String Methods and Built-in Functions
- 5Handling Strings
- Positive index of last character in stringp.176
- Negative index of first character in stringp.176
- Number of characters in substring slicep.179
A string is an immutable sequence composed of one or more Unicode characters enclosed in single, double, or triple quotes.
p.175Triple-quoted strings can span across multiple lines, whereas strings enclosed in single or double quotes cannot.
p.175Python does not have a separate character data type; an individual character is treated as a string of length one.
p.176Individual characters in a string are accessed via indexing in square brackets, with positive indices starting at 0 for the leftmost character.
p.176Negative indices access string characters from right to left, where the rightmost character has index -1 and the leftmost has index -n.
p.176Specifying a string index outside the valid range of 0 to n-1 (or -n to -1) causes Python to raise an IndexError.
p.176String indices must be integers or expressions evaluating to integers; providing a floating-point index raises a TypeError.
p.176The built-in len() function accepts a string as a parameter and returns the total number of characters it contains.
p.177Strings are immutable in Python, so attempting to modify or replace an existing character using item assignment raises a TypeError.
p.177The concatenation operator (+) joins two operand strings to produce a new string while keeping the original strings unchanged.
p.177The repetition operator (*) repeats a string a specified number of times without altering the original string variable.
p.178The membership operator in evaluates to True if the first string is present as a substring within the second string, and False otherwise.
p.178The membership operator not in evaluates to True if the first string is not present as a substring within the second string, and False otherwise.
p.178The slice str1[n:m] returns a substring starting at index n (inclusive) and ending at index m (exclusive), yielding m-n characters.
p.179In string slicing, an end index that exceeds the length of the string is automatically truncated to the end without raising an IndexError.
p.179When slicing with a positive step, if the first index is greater than or equal to the second index, Python returns an empty string.
p.179Omitting the first index in str1[:m] starts the slice from index 0, whereas omitting the second index in str1[n:] slices through the end of the string.
p.179The third index in slice str1[n:m:k] specifies the step size k, extracting every kth character starting from index n up to m-1.
p.179Specifying a step size of -1 with omitted start and stop indices as str1[::-1] returns a copy of the string in reverse order.
p.180Traversing a string means accessing each character sequentially from beginning to end using either a for loop or a while loop.
p.180In for loop traversal, iteration begins at the first character and automatically terminates once the last character of the string is processed.
p.180In while loop traversal, an explicit index variable is initialized to 0 and incremented on each iteration until it reaches len(str1).
p.180The title() method returns a string in which the first letter of every word is converted to uppercase and all remaining letters are lowercase.
p.180The lower() and upper() methods return copies of the string with all cased characters converted to lowercase and uppercase, respectively.
p.181The count(str, start, end) method returns the number of non-overlapping occurrences of substring str within the optional start and end index bounds.
p.181The find(str, start, end) method returns the lowest index where substring str begins, or returns -1 if the substring is not present.
p.181The index() method operates identically to find(), but raises a ValueError exception when the specified substring is not found.
p.181The startswith() and endswith() methods return True if the string begins or ends with the supplied substring, respectively, and False otherwise.
p.181The isalnum() method returns True if all characters in the string are alphanumeric (letters or numbers) and the string is non-empty.
p.182The islower() and isupper() methods return True if a non-empty string contains at least one cased letter and all cased letters are lowercase or uppercase.
p.182The isspace() method returns True if a non-empty string contains only whitespace characters such as blanks, tabs, newlines, and carriage returns.
p.183The istitle() method returns True if the string is non-empty and formatted in title case with each word capitalized and the rest lowercase.
p.183The lstrip(), rstrip(), and strip() methods return new strings with leading, trailing, or both leading and trailing whitespace characters removed.
p.183The replace(oldstr, newstr) method returns a copy of the string with all occurrences of substring oldstr replaced by newstr.
p.183The separator.join(str1) method concatenates the characters of str1, inserting the calling separator string between each character.
p.183The partition(sep) method splits the string at the first occurrence of sep, returning a 3-tuple of (part_before, separator, part_after).
p.184If the separator is not found, partition(sep) returns a 3-tuple containing the full original string followed by two empty strings.
p.184The split() method breaks a string into a list of substrings delimited by the specified separator, defaulting to whitespace when omitted.
p.184A user-defined function can count occurrences of a specific character by traversing each character with a for loop and incrementing a counter variable.
p.184Because strings cannot be modified in place, replacing specific characters requires constructing and accumulating characters into a new string.
p.185A string can be displayed in reverse without creating a new string by iterating backward with range(-1, -len(st)-1, -1) and printing each indexed character.
p.185A palindrome is a string that reads the same forwards and backwards, which can be verified by comparing characters from both ends moving towards the center.
p.186In a two-pointer palindrome check, indices i and j start at 0 and len(st)-1 respectively, checking character equality while i is less than or equal to j.
p.186
Lists
8 topics · 42 facts
- 1Introduction to List
- 2List Operations
- 3Traversing a List
- 4List Methods and Built-in Functions
- 5Nested Lists
- 6Copying Lists
- 7List as Argument to a Function
- 8List Manipulation
In Python, a list is an ordered sequence of mutable elements enclosed in square brackets and separated by commas.
p.189Unlike a string which consists only of characters, a list can contain elements of different data types including integers, floats, strings, tuples, and other lists.
p.189List elements are indexed starting from 0 for forward indexing and from -1 for backward indexing, where -n accesses the first element of a list of length n.
p.190Attempting to access a list element using an index that is outside the range of valid indices raises an IndexError.
p.190Lists are mutable in Python, allowing individual elements to be modified or replaced in-place after creation using index assignment.
p.190The concatenation operator + joins two or more lists together into a new list without modifying the original lists.
p.190The concatenation operator + requires both operands to be lists; attempting to concatenate a list with a different data type raises a TypeError.
p.191The repetition operator * replicates the elements of a list a specified integer number of times to produce a new list.
p.191The membership operator in evaluates to True if an element exists in the list and False otherwise, while not in returns True if the element is absent.
p.191List slicing extracts a sublist using the syntax list[start:stop:step], returning elements from index start up to but not including index stop.
p.192When slicing a list, specifying a stop index beyond the list length does not raise an IndexError; Python simply truncates the slice at the end of the list.
p.192When start is greater than or equal to stop with a positive step size, the slice operation results in an empty list [].
p.192A slice with a negative step of -1 and omitted start and stop indices, written as list[::-1], returns the entire list in reverse order.
p.192Traversing a list involves accessing each of its elements sequentially, which can be accomplished using either a for loop or a while loop.
p.192A list can be traversed by element directly using the loop header for item in myList, or by index using range(len(myList)) to access myList[i].
p.193When traversing a list using a while loop, an explicit index variable must be initialized to 0 and incremented on each iteration while it is less than len(myList).
p.193The built-in function len(list) returns the total number of elements present in the list passed as an argument.
p.193The list() function creates an empty list when called without arguments and converts any iterable sequence passed to it into a list.
p.194The append() method adds a single element to the end of a list in-place; if passed a list as an argument, it adds that list as a single nested element.
p.194The extend() method appends each element of the iterable passed as an argument individually to the end of the existing list.
p.194The insert(index, element) method inserts an element at the specified index, shifting existing elements at and after that position to the right.
p.194The count(element) method returns the number of times a specified element appears in the list, returning 0 if it is not found.
p.194The index(element) method returns the index of the first occurrence of an element in the list and raises a ValueError if the element is not found.
p.194The remove(element) method removes the first occurrence of a specified value from the list and generates a ValueError if the value does not exist.
p.194The pop([index]) method removes and returns the element at the specified index, or removes and returns the last element of the list if no index is passed.
p.194The reverse() method reverses the order of elements in the given list in-place and does not create a new list.
p.195The sort() method sorts elements of a list in-place in ascending order by default, or descending order if reverse=True is specified.
p.195The built-in function sorted(list) creates and returns a new sorted list consisting of the same elements, leaving the original list unmodified.
p.195The built-in functions min(), max(), and sum() return the smallest element, largest element, and total sum of the elements in a numerical list, respectively.
p.195A nested list is a list that contains another list as one of its elements.
p.195Elements in a nested list are accessed using two indices myList[i][j], where index i accesses the inner sublist and index j accesses the element within that sublist.
p.196Assigning one list variable to another using list2 = list1 does not create a new list but creates an alias, meaning both variables reference the exact same list object.
p.196Because list aliasing shares a single underlying object, any modifications made through one variable are immediately reflected in the aliased variable.
p.196A distinct clone of a list can be created using full slice notation newList = oldList[:] or by calling the list constructor newList = list(oldList).
p.196A distinct copy of an existing list can be created by importing the copy module and calling copy.copy(oldList).
p.197When a list is passed as an argument to a function, Python passes a reference to the list object, retaining the same object id inside the function.
p.197Modifying the elements of a passed list inside a function directly mutates the original list object, reflecting the changes in the caller.
p.198If a list parameter is assigned a new list inside a function, it references a new local object, and subsequent modifications do not affect the original list in the caller.
p.198Before modifying an element at index i using myList[i] = newElement or deleting it with pop(i), a program should check that i is less than len(myList) to avoid an IndexError.
p.200Before deleting an element by value using remove(element), checking if element in myList prevents the program from crashing with a ValueError.
p.200To calculate the average of numerical items in a list, a function iterates through the list to accumulate the total sum and then divides it by the total count n.
p.202In a linear search, each element is compared with the target value sequentially from index 0; if a match is found, its position is returned, otherwise None is returned.
p.203
Tuples and Dictionaries
12 topics · 44 facts
- 1Introduction to Tuples
- 2Tuple Operations
- 3Tuple Methods and Built-in Functions
- 4Tuple Assignment
- 5Nested Tuples
- 6Tuple Handling
- 7Introduction to Dictionaries
- 8Dictionaries are Mutable
- 9Dictionary Operations
- 10Traversing a Dictionary
- 11Dictionary Methods and Built-in Functions
- 12Manipulating Dictionaries
A tuple is an ordered sequence of elements of different data types, enclosed in parentheses (round brackets) and separated by commas.
p.207If a tuple contains only a single element, the element must be followed by a comma, otherwise Python treats it as a standard integer or string.
p.207A sequence of comma-separated elements without parentheses is treated as a tuple by default in Python.
p.208Elements of a tuple can be accessed using zero-based positive indexing or negative indexing from -1, and out-of-range indexing raises an IndexError.
p.208Tuples are immutable, meaning their elements cannot be changed after creation, and attempting item assignment raises a TypeError.
p.208Although a tuple is immutable, an element within a tuple that is of a mutable type, such as a list, can be modified in-place.
p.209Because tuples are immutable, iterating through a tuple is faster compared to iterating through a mutable list.
p.209The concatenation operator + joins two tuples into a new tuple, and attempting to concatenate a tuple with a non-tuple causes a TypeError.
p.209The repetition operator * creates a new tuple by repeating the tuple elements, requiring the first operand to be a tuple and the second to be an integer.
p.210The membership operator in returns True if an element is present in the tuple, while not in returns True if the element is absent.
p.210Tuple slicing using tuple[start:end] extracts elements from index start up to end minus one into a new tuple.
p.210The built-in len() function returns the number of elements in a tuple, while tuple() creates an empty tuple or converts a sequence into a tuple.
p.211The tuple count() method returns the number of times a specified element appears in the tuple, returning 0 if the element is not found.
p.211The tuple index() method returns the index of the first occurrence of an element in a tuple, and raises a ValueError if the element is absent.
p.211Tuple assignment allows a tuple of variables on the left of an assignment operator to be assigned respective values from a tuple on the right in one step.
p.212In tuple assignment, the number of variables on the left must equal the number of elements in the tuple on the right, otherwise a ValueError is raised.
p.212If expressions appear on the right side of a tuple assignment, all expressions are evaluated first before values are assigned to the left-side variables.
p.212A tuple nested inside another tuple is called a nested tuple, and its inner elements are accessed using consecutive indexing brackets.
p.213The escape characters \t and \n can be used within output strings to insert horizontal tabs and newline breaks respectively.
p.213Tuple assignment enables swapping the values of two variables without using a temporary variable via the statement (num1, num2) = (num2, num1).
p.213A Python function can return multiple values by returning them as a tuple, which the caller can unpack into separate variables.
p.214A tuple can be constructed incrementally by repeatedly concatenating each new element as a single-element tuple using the + operator.
p.214A dictionary is a mapping data type consisting of key-value pairs called items, where each key is separated from its value by a colon.
p.215Dictionary keys must be unique and must belong to an immutable data type such as a number, string, or tuple, while values can be of any data type.
p.215An empty dictionary is created using empty curly braces {} or by calling the built-in dict() function without arguments.
p.215Items in a dictionary are ordered, meaning key-value pairs are preserved and returned in the order in which they were initially entered.
p.215Dictionary items are accessed via keys rather than numeric indices, and attempting to access a key not present in the dictionary raises a KeyError.
p.216Dictionaries are mutable data structures, allowing their key-value pairs to be modified, added, or deleted after the dictionary has been created.
p.216A new item is added to a dictionary by assigning a value to a new key using the assignment syntax dict1[new_key] = value.
p.216An existing dictionary item is modified by assigning a new value to an existing key, which overwrites the previous value mapped to that key.
p.216The membership operator in checks if a key is present in the dictionary and returns True if found, otherwise False.
p.217The membership operator not in returns True if a specified key does not exist in the dictionary, and returns False if the key is present.
p.217Dictionary membership operators in and not in evaluate membership exclusively for keys, not for dictionary values.
p.217Traversing a dictionary using a for key in dict loop iterates over each key, allowing corresponding values to be accessed via dict[key].
p.217Traversing a dictionary using for key, value in dict.items() iterates over key-value pairs as tuples, accessing keys and values simultaneously.
p.217The built-in len() function returns the total number of key-value pairs stored in the dictionary passed as an argument.
p.218The dict() constructor creates a new dictionary from an iterable sequence of key-value pairs, such as a list of two-element tuples.
p.218The keys(), values(), and items() dictionary methods return view objects containing all keys, all values, and all (key, value) tuples respectively.
p.218The dict.get() method returns the value for a given key, and returns None instead of raising a KeyError if the key is absent.
p.219The dict.update() method appends key-value pairs from one dictionary into another, overwriting values for any duplicate keys.
p.219The del statement removes a key-value item with del dict[key], or completely deletes the entire dictionary variable from memory with del dict.
p.219The dict.clear() method removes all items from a dictionary, leaving it as an empty dictionary {}.
p.219Frequencies of elements in a sequence can be determined with a dictionary by checking if each item is in the dictionary to increment its count or initialise it to 1.
p.221A dictionary can serve as a lookup table to map discrete input values to replacement values, such as mapping numeric digits to number names.
p.222
Societal Impact
6 topics · 42 facts
- 1Digital Footprints
- 2Digital Society and Netizen
- 3Data Protection
- 4Cyber Crime
- 5Indian Information Technology Act (IT Act)
- 6Impact on Health
A digital footprint is the trail of data reflecting the activities performed by an individual online whenever they surf the Internet using digital devices.
p.230Active digital footprints encompass data that a user intentionally submits online, such as emails written, social media posts, and responses submitted on websites or apps.
p.230Passive digital footprints are created unintentionally when browsing the web, visiting websites, or using mobile apps, and include IP addresses, device details, and browsing history.
p.230Digital footprints are predominantly stored on remote servers hosting the applications, meaning a user cannot easily erase them or guarantee their full elimination from the Internet.
p.230Digital footprints can be used to trace a user's physical location, device specifications, and online behavior, which may be utilised for targeted advertising or exploitation.
p.230A digital citizen or netizen is anyone who uses digital technology along with the Internet and practices safe, ethical, and legal conduct online.
p.231Ethical netiquette requires avoiding copyright violations by obtaining permission before using copyrighted material, and sharing only true, verified, and non-redundant expertise.
p.231Respectful netiquette entails honouring other users' privacy by never sharing their private communications, images, or documents without mutual consent, and respecting diversity.
p.232Cyber bullying is repeated insulting, degrading, threatening, or intimidating online behaviour aimed at publicly ridiculing, hurting, or harassing a victim.
p.232An Internet troll deliberately sows discord by posting inflammatory or off-topic messages for amusement; the most effective way to discourage trolls is to ignore their comments.
p.232Communication etiquette requires being precise by respecting time and bandwidth limits, avoiding large email attachments by using cloud links, and ignoring unsolicited spam emails.
p.233Communication must remain polite and non-aggressive in both synchronous channels like chat or video calls and asynchronous channels like emails or forum posts.
p.233Social media etiquette requires maintaining account security with strong, frequently changed passwords and never sharing personal credentials such as usernames and passwords.
p.234Users should never arrange to meet an online acquaintance in person because online personas can be fabricated, and one should critically validate news before believing or reposting it.
p.234Content uploaded to social media platforms is stored permanently on remote servers even if deleted locally, requiring extreme caution before sharing sensitive personal photos or files.
p.234Sensitive data includes biometric, health, financial, or personal records whose breach can cause substantial harm, requiring protection through encryption and authentication.
p.235Intellectual Property refers to creations of the human mind, including inventions, literary and artistic expressions, designs, and symbols, which are legally protected through copyrights, patents, and trademarks.
p.235Copyright is automatically granted to creators of original works, conferring exclusive legal rights to reproduce, distribute, display, perform, and create derivative works from the material.
p.236A patent is an exclusive legal right granted upon application for an invention, protecting it for a period of 20 years and allowing the patentee to control its commercial manufacture and distribution.
p.236A trademark protects visual symbols, words, names, logos, or slogans that distinguish the commercial goods or services of one enterprise from another, preventing the use of confusingly similar marks.
p.236For software intellectual property, the program code is protected by copyright, the functional expression of the idea is protected by a patent, and the brand name and logo are protected by a registered trademark.
p.236Plagiarism is the unethical act of presenting someone else's work, ideas, or derived concepts as one's own without providing adequate citation or acknowledging the original source.
p.237Copyright infringement occurs when copyrighted material is used, downloaded, or reproduced without the owner's permission or payment, even if source attribution is given.
p.237Trademark infringement is the unauthorized commercial use of a registered trademark on products or services, which can lead to legal proceedings by the trademark owner.
p.237Creative Commons licenses grant recipients rights to copy, modify, and redistribute creative works such as websites, music, and text while allowing authors to specify licensing terms.
p.238The GNU General Public License provides end users the freedom to run, study, share, and modify software, requiring all derivative works to preserve the same licensing rights.
p.238Software piracy is the unauthorized reproduction, use, or distribution of software, which amounts to illegal copyright infringement regardless of whether it is done for sale or personal use.
p.238Cyber crime encompasses criminal activities carried out in a digital environment where a computer is either the target of the crime or the tool used to commit the offense.
p.239A computer virus is malicious self-replicating code that corrupts systems or destroys data, whereas malware is software designed specifically to gain unauthorized access to computer systems.
p.239Ethical hackers (white hat hackers) identify vulnerabilities during software testing and report them to system owners with positive intent, thereby strengthening cybersecurity.
p.239Non-ethical hackers (black hat hackers or crackers) break into digital systems without authorization to steal sensitive data, cause system damage, or obtain illicit monetary gain.
p.240Phishing is an unlawful attempt to fraudulently obtain sensitive credentials like passwords and banking details using deceptive emails or websites that mimic authentic institutions.
p.240Identity theft involves unlawfully obtaining a person's identifiable data—such as banking credentials, Aadhaar, or PAN—to commit financial fraud, criminal evasion, or medical theft.
p.240Ransomware is malicious software that encrypts a victim's computer files and demands payment to restore access or stop the public release of confidential information.
p.241Cyber crime prevention requires maintaining regular offline data backups, using updated antivirus software, downloading software exclusively from HTTPS sites, and configuring strong unique passwords.
p.241The Indian Information Technology Act 2000 (amended in 2008) provides a legal framework for electronic governance by legally recognizing electronic records and digital signatures.
p.242Digital signatures are electronic equivalents of paper certificates issued by licensed Certifying Authorities under Section 24 of the Indian IT Act 2000 to authenticate digital records.
p.242The Cyber Appellate Tribunal is established under the IT Act to resolve cyber disputes, including hacking, source document tampering, password misuse, and unauthorized data disclosure.
p.242Ergonomics is the science of designing workplaces, equipment, and systems to ensure safety and comfort, reducing physical fatigue and repetitive strain injuries from prolonged computer usage.
p.243Proper workstation ergonomics requires a viewing distance of 19–24 inches, viewing angle of 30 degrees, lumbar support for the lower back, straight wrists, and 90-degree seat and knee angles.
p.243Eye strain caused by digital screen glare can be mitigated by periodically shifting focus to distant objects, taking regular breaks, and engaging in outdoor physical activities.
p.244Improper posture, unaligned keyboard usage, and excessive screen time can cause chronic wrist and finger injuries, musculoskeletal pain, physical fatigue, stress, and obesity.
p.244