[go: up one dir, main page]

0% found this document useful (0 votes)
5 views5 pages

Computer Science

The document covers fundamental concepts in computational thinking and programming using Python, including Python basics, conditional and iterative statements, debugging, data structures, file handling, and functions. It also discusses computer networks, including data communication, network devices, protocols, and web services, as well as database management concepts and SQL commands. Finally, it explains how to interface Python with SQL databases using the Python DB-API.

Uploaded by

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

Computer Science

The document covers fundamental concepts in computational thinking and programming using Python, including Python basics, conditional and iterative statements, debugging, data structures, file handling, and functions. It also discusses computer networks, including data communication, network devices, protocols, and web services, as well as database management concepts and SQL commands. Finally, it explains how to interface Python with SQL databases using the Python DB-API.

Uploaded by

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

---

## 🧠 UNIT I: COMPUTATIONAL THINKING & PROGRAMMING - 2

### CHAPTER 1: Revision of Python Basics


```
Python Features:
- Interpreted, dynamic, high-level language
- Supports both script and interactive modes
- Uses indentation instead of brackets
- Dynamically typed variables

Tokens:
- Identifiers, Keywords, Literals, Operators, Punctuators

Data Types:
- Numeric: int, float, complex
- Sequence: str, list, tuple
- Set and Mapping: set, dict
- Special: None

Operators:
- Arithmetic: +, -, *, /, %, //, **
- Relational: <, >, <=, >=, !=, ==
- Logical: and, or, not
- Assignment: =, +=, -=, *=, etc.
- Bitwise: &, |, ^, ~, <<, >>
- Membership: in, not in
- Identity: is, is not
```

---

### CHAPTER 2: Conditional & Iterative Statements


```
Conditional Statements:
- if
- if-else
- if-elif-else
- nested if

Looping Statements:
- for loop (with range())
- while loop (with optional else block)
- nested loops
- break and continue statements

range() Variants:
- range(n)
- range(start, end)
- range(start, end, step)
```

---

### CHAPTER 3: Debugging and Python Modules


```
Error Types:
- Syntax Error
- Logical Error
- Runtime Error

Debugging: Systematic process to locate and fix bugs

Modules:
- Importing: import module / from module import object
- math: sqrt(), pow(), fabs(), ceil(), floor()
- random: random(), choice()
- statistics: mean(), median(), mode()
```

---

### CHAPTER 4: List, Tuple, Dictionary


```
List:
- Mutable, indexed, allows duplicates
- Methods: append(), extend(), insert(), remove(), sort(), pop()

Tuple:
- Immutable, indexed
- Methods: len(), max(), min()

Dictionary:
- Key-value pair structure, mutable
- Methods: items(), keys(), values(), update(), clear()
```

---

### CHAPTER 5: Strings


```
Operations:
- Concatenation (+)
- Replication (*)
- Membership (in, not in)
- Slicing: string[n:m]

Methods:
- index(), count(), find(), replace(), split(), join(), strip()
- isalpha(), isnumeric(), lower(), upper(), title(), capitalize()
```

---

### CHAPTER 6: Functions


```
Definition: def function_name(parameters):

Types:
- Built-in (e.g. print(), input(), len())
- User-defined

Function Concepts:
- Parameters: Positional, Default, Keyword, Variable-length
- Return values: Single or Multiple
- Mutable vs Immutable objects
- Unpacking: *args for lists/tuples, **kwargs for dictionaries
```

---

## 💾 CHAPTER 7: File Handling


```
File Types:
- Text (.txt)
- Binary (.dat)
- CSV (.csv)

Basic Operations:
- open(), read(), write(), close()
- Modes: r, w, a, r+, w+, a+, rb, wb, ab

Methods:
- read(), readline(), readlines()
- write(), writelines()
- tell(), seek()

Binary Files:
- pickle module: dump(), load()
- Serialization (pickling), Deserialization (unpickling)

CSV Files:
- csv.reader(), csv.writer()
- Delimiter, Quotechar
```

---

## 🧱 CHAPTER 8: Data Structures


```
List:
- Indexed, mutable, supports slicing and traversal

Stack (LIFO):
- push: list.append()
- pop: list.pop()
- peek, size, isEmpty

Operations:
- Expression conversion
- Parenthesis checking
- Reversal

Nested list: List within list


```

---

## 🌐 UNIT II: COMPUTER NETWORKS

### CHAPTER 5: Data Communication & Topologies


```
Switching Techniques:
- Circuit, Message, Packet Switching
Transmission Media:
- Twisted Pair, Coaxial, Optical Fiber, Infrared, Radio Wave, Microwave

Terms:
- Bandwidth, Data Rate, Channel, Protocols

Topologies:
- Bus, Star, Tree

Network Types:
- PAN, LAN, MAN, WAN
```

---

### CHAPTER 6: Network Devices & Protocols


```
Devices:
- Modem, RJ45, Switch, Hub, Router, Gateway, Repeater, Ethernet card

Protocols:
- HTTP, HTTPS, FTP, SMTP, POP3, Telnet, TCP/IP, VoIP, PPP
```

---

### CHAPTER 7: Web Services


```
Definitions:
- WWW: Web pages linked via hyperlinks
- HTML, XML, URL, Domain Name

Components:
- Web Browser, Web Server, Hosting
```

---

## UNIT III: DATABASE MANAGEMENT

### CHAPTER 8: Database Concepts


```
Models:
- Hierarchical, Network, Relational

Terms:
- Table, Row, Column, Attribute, Domain
- Primary Key, Foreign Key, Candidate Key, Super Key

Levels of Abstraction:
- Internal, Logical, External
```

---

### CHAPTER 9: SQL (Structured Query Language)


```
Commands:
- DDL: CREATE, DROP, ALTER
- DML: SELECT, INSERT, UPDATE, DELETE
- TCL: COMMIT, ROLLBACK

Clauses:
- WHERE, ORDER BY, GROUP BY, HAVING

Operators:
- Arithmetic, Relational, Logical, IN, BETWEEN, LIKE

Functions:
- Aggregate: SUM(), AVG(), MAX(), MIN(), COUNT()
- String: LOWER(), UPPER(), LENGTH()
- Date: CURDATE(), NOW()

Constraints:
- PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK, DEFAULT

Joins:
- INNER, NATURAL, EQUI
```

---

## 🤝 CHAPTER 10: Interface of Python with SQL


```
Python DB-API:
- import MySQLdb or sqlite3

Connection:
conn = connect(db info)
cursor = conn.cursor()

Execution:
- cursor.execute()
- fetchone(), fetchall(), fetchmany()

Transaction:
- conn.commit(), conn.rollback()

File I/O vs DB I/O:


- Read from/write to databases using SQL queries
- Cursor object methods for execution
```

---

You might also like