🐍 RBSE Class 12 — कम्प्यूटर विज्ञान (Computer Science)
सम्पूर्ण Short Notes 2026
📝 Board Exam Tests → RBSE Class 10 SST Exam Kit | Science Exam Kit
📋 विषय-सूची (Table of Contents)
🐍 Python Programming
🔹 Python की विशेषताएँ
Python एक High-level, Interpreted, Object-Oriented, General-purpose प्रोग्रामिंग भाषा है। इसे Guido van Rossum ने 1991 में विकसित किया। विशेषताएँ: सरल Syntax, Open Source, Platform Independent (Windows/Linux/Mac), Dynamic Typing, Extensive Libraries, Interactive Mode (IDLE)।
🔹 Data Types (डाटा प्रकार)
| Type | Example | Mutable? | विवरण |
|---|---|---|---|
| int | 10, -5, 0 | Immutable | पूर्णांक |
| float | 3.14, -2.5 | Immutable | दशमलव संख्या |
| str | "Hello", 'Hi' | Immutable | टेक्स्ट (String) |
| bool | True, False | Immutable | बूलियन |
| list | [1,2,3] | Mutable ✅ | क्रमबद्ध, बदलने योग्य |
| tuple | (1,2,3) | Immutable | क्रमबद्ध, बदलने अयोग्य |
| dict | {"a":1} | Mutable ✅ | Key:Value जोड़ी |
| set | {1,2,3} | Mutable ✅ | अक्रमबद्ध, unique |
🔹 Operators (संकारक)
Arithmetic: +, -, *, /, // (floor division), % (modulus), ** (power)। Relational: ==, !=, <, >, <=, >=। Logical: and, or, not। Assignment: =, +=, -=, *=। Identity: is, is not। Membership: in, not in।
ध्यान दें: // (Floor Division) → 7//2 = 3 (दशमलव हटाता है)। ** (Power) → 2**3 = 8। % (Modulus) → 7%2 = 1 (शेषफल)।
🔹 Control Flow (नियंत्रण प्रवाह)
🔹 String Operations
🔹 List Operations
🔹 Tuple और Dictionary
🔹 Function (फंक्शन) — def keyword
Function कोड का पुन:उपयोगी (Reusable) ब्लॉक है। Built-in Functions: print(), len(), input(), type(), int(), float(), str(), range(), max(), min(), sum(), sorted()। User-defined Functions: def keyword से बनाते हैं।
🔹 Types of Arguments
1. Positional Arguments: क्रम (order) से मैच होते हैं। 2. Default Arguments: पहले से मान दिया होता है। 3. Keyword Arguments: नाम से पास — greet(name="Ram")। 4. Variable-length Arguments: *args (tuple), **kwargs (dict)।
🔹 Scope of Variables
🔹 Recursion (पुनरावृत्ति)
🔹 Modules (मॉड्यूल)
Module = Python file (.py) जिसमें functions, classes होते हैं। import math — math.sqrt(25)→5.0, math.pi→3.14159, math.ceil(4.2)→5, math.floor(4.8)→4, math.pow(2,3)→8.0। import random — random.randint(1,10), random.random() (0 to 1), random.choice([1,2,3])। import statistics — statistics.mean(), statistics.median(), statistics.mode()।
🔹 Exception क्या है?
प्रोग्राम चलते समय (Runtime) होने वाली त्रुटि को Exception कहते हैं। प्रमुख Exceptions: ZeroDivisionError (0 से भाग), ValueError (गलत value — int("abc")), TypeError (गलत type — "5"+5), IndexError (list में गलत index), KeyError (dict में गलत key), FileNotFoundError (file नहीं मिली), NameError (undefined variable), SyntaxError (गलत syntax)।
🔹 try-except-else-finally
🔹 raise statement
🔹 File Open Modes
| Mode | विवरण | File नहीं है तो? |
|---|---|---|
| 'r' | Read only (default) | Error |
| 'w' | Write (overwrite) | नई file बनाता है |
| 'a' | Append (अंत में जोड़ता) | नई file बनाता है |
| 'r+' | Read + Write | Error |
| 'rb' | Read Binary | Error |
| 'wb' | Write Binary | नई file |
🔹 Text File Operations
🔹 CSV File Handling
🔹 Binary File Handling
🔹 Stack क्या है?
Stack एक LIFO (Last In First Out) डाटा संरचना है — जो element सबसे अंत में जोड़ा जाता है, वह सबसे पहले निकलता है। उदाहरण: प्लेटों का ढेर, Undo operation, Browser Back button, Function Call Stack।
🔹 Stack Operations
push(item): Stack में element जोड़ना (top पर)। pop(): Top element हटाना और लौटाना। peek() / top(): Top element देखना (हटाना नहीं)। isEmpty(): Stack खाली है या नहीं। size(): Stack में कितने elements हैं। Overflow: भरे stack में push करना। Underflow: खाली stack से pop करना।
🔹 Stack Implementation using Python List
🔹 Stack Applications
1. Expression Evaluation: Infix to Postfix conversion। 2. Parenthesis Matching: {[()]} balanced है या नहीं। 3. Undo/Redo: Text editors। 4. Browser Back: पिछले pages। 5. Function Calls: Call Stack — recursion में।
🗄️ Database & SQL
🔹 Database और DBMS
Database: संबंधित डाटा का व्यवस्थित संग्रह (Organised Collection)। DBMS (Database Management System): सॉफ्टवेयर जो database बनाने, प्रबंधित करने और access करने में मदद करता है। उदाहरण: MySQL, Oracle, PostgreSQL, MS SQL Server, SQLite।
🔹 Relational Database (RDBMS) — Key Terms
Relation / Table: Rows (Tuples/Records) और Columns (Attributes/Fields) का संग्रह। Degree: Columns की संख्या। Cardinality: Rows की संख्या। Domain: एक column में संभव मानों (Possible Values) का समूह।
🔹 Keys (कुंजियाँ)
Primary Key: प्रत्येक row को विशिष्ट रूप से पहचानने वाला column — NOT NULL, UNIQUE। उदाहरण: Roll_No, Aadhar_No। Foreign Key: एक table का column जो दूसरी table की Primary Key को refer करता है — दो tables में संबंध बनाता है। Candidate Key: Primary Key बन सकने वाले सभी columns। Alternate Key: Candidate Key जो Primary Key नहीं बनी।
| STUDENT Table (Degree=4, Cardinality=3) | |||
|---|---|---|---|
| Roll_No (PK) | Name | Class | Marks |
| 101 | Ram | 12 | 85 |
| 102 | Sita | 12 | 92 |
| 103 | Mohan | 12 | 78 |
🔹 SQL Categories
DDL (Data Definition Language): CREATE, ALTER, DROP — Table की संरचना बनाना/बदलना। DML (Data Manipulation Language): INSERT, UPDATE, DELETE — Data जोड़ना/बदलना/हटाना। DQL (Data Query Language): SELECT — Data पढ़ना/निकालना। TCL: COMMIT, ROLLBACK।
🔹 DDL Commands
🔹 DML Commands
🔹 DQL — SELECT Command
🔹 LIKE Wildcards
% → कोई भी characters (0 या अधिक)। _ → कोई भी एक character। उदाहरण: 'A%' → A से शुरू, '%a' → a पर खत्म, '%an%' → an कहीं भी, '_a%' → दूसरा अक्षर a।
🔹 Aggregate Functions (समूह फंक्शन)
🔹 String & Date Functions
🔹 Cartesian Product & JOIN (Equi-Join)
🔹 mysql.connector Module
Python से MySQL database connect करने के लिए mysql.connector module उपयोग होता है। Steps: 1. Connect → 2. Cursor बनाना → 3. Query Execute → 4. Fetch/Commit → 5. Close।
🔹 UPDATE & DELETE via Python
🔢 Boolean Algebra (बूलियन बीजगणित)
🔹 Boolean Values & Operations
Boolean Algebra में केवल दो मान होते हैं: 0 (False) और 1 (True)। इसे George Boole ने विकसित किया। Digital circuits और Computer logic का आधार है।
🔹 Basic Gates (मूल गेट)
| Gate | Symbol | Expression | Truth Table (A,B→Output) |
|---|---|---|---|
| AND | A·B | Y = A.B | 0,0→0 | 0,1→0 | 1,0→0 | 1,1→1 |
| OR | A+B | Y = A+B | 0,0→0 | 0,1→1 | 1,0→1 | 1,1→1 |
| NOT | A̅ या A' | Y = A̅ | 0→1 | 1→0 (उल्टा) |
| NAND | (A·B)̅ | Y = (A.B)̅ | 0,0→1 | 0,1→1 | 1,0→1 | 1,1→0 |
| NOR | (A+B)̅ | Y = (A+B)̅ | 0,0→1 | 0,1→0 | 1,0→0 | 1,1→0 |
| XOR | A⊕B | Y = A̅B+AB̅ | 0,0→0 | 0,1→1 | 1,0→1 | 1,1→0 |
NAND और NOR को Universal Gates कहते हैं — इनसे कोई भी gate बनाया जा सकता है।
🔹 Boolean Laws (बूलियन नियम)
| Law | AND Form | OR Form |
|---|---|---|
| Identity | A.1 = A | A+0 = A |
| Null | A.0 = 0 | A+1 = 1 |
| Idempotent | A.A = A | A+A = A |
| Complement | A.A̅ = 0 | A+A̅ = 1 |
| Involution | (A̅)̅ = A (double NOT cancel) | |
| Commutative | A.B = B.A | A+B = B+A |
| Associative | (A.B).C = A.(B.C) | (A+B)+C = A+(B+C) |
| Distributive | A.(B+C) = A.B+A.C | A+(B.C) = (A+B).(A+C) |
| Absorption | A.(A+B) = A | A+A.B = A |
🔹 De Morgan's Theorems (डी मॉर्गन प्रमेय)
Theorem 1: (A+B)̅ = A̅.B̅ — "NOR = AND of NOTs"
Theorem 2: (A.B)̅ = A̅+B̅ — "NAND = OR of NOTs"
याद रखने का तरीका: "Break the bar, change the sign" — ऊपर की रेखा तोड़ो, + को . में बदलो (और . को + में)।
🔹 SOP & POS
SOP (Sum of Products): Minterms का योग। जहाँ output = 1, उन rows के minterms को OR (+) से जोड़ना। उदाहरण: F = A̅B + AB̅ + AB।
POS (Product of Sums): Maxterms का गुणनफल। जहाँ output = 0, उन rows के maxterms को AND (.) से जोड़ना।
🌐 Communication & Networking (संचार एवं नेटवर्किंग)
🔹 नेटवर्क के प्रकार (Types of Networks)
PAN (Personal Area Network): व्यक्तिगत — Bluetooth, USB, 10m तक। LAN (Local Area Network): एक भवन/कैम्पस — स्कूल लैब, ऑफिस, तेज़ गति। MAN (Metropolitan Area Network): एक शहर — केबल TV नेटवर्क। WAN (Wide Area Network): देश/विश्व — इंटरनेट सबसे बड़ा WAN।
🔹 Network Topology (नेटवर्क टोपोलॉजी)
| Topology | संरचना | लाभ | हानि |
|---|---|---|---|
| Bus | एक मुख्य केबल (Backbone) | सस्ता, सरल | केबल खराब → सब बंद |
| Star ⭐ | सब Hub/Switch से जुड़े | 1 खराब → बाकी चालू | Hub खराब → सब बंद |
| Ring | वृत्ताकार, एक दिशा | No collision | 1 नोड खराब → प्रभावित |
| Mesh | हर एक से हर एक जुड़ा | सबसे विश्वसनीय | सबसे महँगा |
| Tree | Star + Bus (Hierarchical) | बड़े नेटवर्क | Root खराब → समस्या |
🔹 Transmission Media
Guided (Wired): Twisted Pair — सस्ता, LAN, 100m (UTP/STP); Coaxial Cable — केबल TV, बेहतर bandwidth; Fiber Optic — प्रकाश (Light), सबसे तेज़, लंबी दूरी, EMI-proof, महँगा।
Unguided (Wireless): Radio Waves (Wi-Fi, FM); Microwaves (Tower-to-Tower); Infrared (Remote); Satellite (VSAT, GPS)।
🔹 Network Devices
Modem: Digital↔Analog (Modulator+Demodulator)। Hub: Broadcast सबको — unintelligent। Switch: केवल destination port — intelligent। Router: दो अलग networks जोड़ता, IP-based routing। Gateway: अलग protocol वाले networks जोड़ता। Bridge: दो LAN जोड़ता। Repeater: कमज़ोर signal amplify करता।
🔹 Protocols & IP Address
TCP/IP: Internet का foundation — TCP (reliable delivery) + IP (addressing)। HTTP/HTTPS: Web pages (Port 80/443)। FTP: File transfer (Port 21)। SMTP: Email भेजना (Port 25)। POP3/IMAP: Email पाना। DNS: Domain Name → IP Address। TELNET: Remote login। PPP: Point-to-Point Protocol।
IPv4: 32-bit, 4 octets (192.168.1.1) — ~4.3 अरब addresses। IPv6: 128-bit, hexadecimal — असीमित। MAC Address: NIC का physical address, 48-bit।
🔹 Web Terminology
WWW: Tim Berners-Lee, 1989, CERN। URL: Protocol + Domain + Path। Web Browser: Chrome, Firefox। Web Server: Apache, Nginx। Website vs Web Page: Website = Web Pages का संग्रह। Domain Types: .com, .edu, .gov, .org, .in, .net। भारत में Internet: 15 Aug 1995, VSNL।
🔹 Cyber Security (साइबर सुरक्षा)
इंटरनेट पर डाटा, सूचना और systems को अनधिकृत पहुँच, चोरी और क्षति से बचाना। Threats: Virus, Worms, Trojans, Spyware, Ransomware, Phishing, Hacking, Identity Theft।
🔹 Malware के प्रकार
Virus: Host program से जुड़कर फैलता है, files नष्ट करता है। Worm: बिना host के नेटवर्क से फैलता, system slow। Trojan Horse: उपयोगी सॉफ्टवेयर जैसा दिखता, अंदर malicious code। Spyware: गुप्त रूप से जासूसी, personal data चुराता। Adware: अनचाहे विज्ञापन दिखाता। Ransomware: Data encrypt करके फिरौती माँगता। Keylogger: Keyboard strokes record करता।
🔹 Cyber Crimes
Hacking: अनधिकृत system access। Phishing: नकली website/email से personal data चुराना (Bank details, passwords)। Cyberstalking: Online पीछा करना, धमकाना। Identity Theft: किसी की पहचान चुराकर दुरुपयोग। Cyberbullying: Online उत्पीड़न। Data Theft: गोपनीय data चोरी।
🔹 सुरक्षा उपाय (Security Measures)
Firewall: Network पर आने-जाने वाले traffic को filter करता — अनधिकृत access रोकता। Antivirus: Malware detect और remove करता। Encryption: Data को coded form में बदलना — HTTPS, SSL/TLS। Strong Passwords: कम से कम 8 characters, uppercase + lowercase + numbers + special characters। Two-Factor Authentication (2FA): Password + OTP/Biometric। Regular Updates: OS और software update रखना। Backup: नियमित data backup।
🔹 IT Act 2000 (भारत)
भारत का पहला साइबर कानून — Information Technology Act 2000 (2008 में संशोधित)। Digital signatures को कानूनी मान्यता, साइबर अपराधों के लिए दंड का प्रावधान। Section 66: Computer hacking। Section 43: Unauthorized access। CERT-In: Indian Computer Emergency Response Team — साइबर सुरक्षा की nodal agency।
🔹 Digital Footprint & Net Ethics
Digital Footprint: इंटरनेट पर हमारी गतिविधियों का रिकॉर्ड — सोच-समझकर share करें। Intellectual Property Rights (IPR): Copyright, Patent, Trademark। Plagiarism: दूसरों के काम की चोरी — अनैतिक। Open Source: स्वतंत्र रूप से उपलब्ध सॉफ्टवेयर — Linux, Python, Apache, LibreOffice। Creative Commons (CC): कुछ अधिकारों के साथ sharing। Free Software Foundation: Richard Stallman — GNU, GPL License।
🔹 E-Waste Management
पुराने electronic उपकरणों का सही निपटान — toxic materials (lead, mercury, cadmium) पर्यावरण के लिए हानिकारक। Recycle, Refurbish, Donate — responsible disposal ज़रूरी।


No comments:
Post a Comment