0% found this document useful (0 votes)
2 views3 pages

Class 12 Python Networking Notes

The document provides comprehensive notes on Python programming and computer networking for Class 12. It covers Python fundamentals including data types, operators, control structures, functions, file handling, exception handling, and data structures like lists and stacks. Additionally, it outlines key concepts in computer networking, including types, components, topologies, and protocols.

Uploaded by

mishbamaheen98
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)
2 views3 pages

Class 12 Python Networking Notes

The document provides comprehensive notes on Python programming and computer networking for Class 12. It covers Python fundamentals including data types, operators, control structures, functions, file handling, exception handling, and data structures like lists and stacks. Additionally, it outlines key concepts in computer networking, including types, components, topologies, and protocols.

Uploaded by

mishbamaheen98
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
You are on page 1/ 3

Python & Networking Notes - Class 12

Review of Python I

Tokens in Python: Keywords, Identifiers, Literals, Operators, Punctuators.

Variables & Data Types: int, float, str, bool, complex.

Operators:

- Arithmetic: +, -, *, /, //, %, **

- Relational: ==, !=, <, >, <=, >=

- Logical: and, or, not

Conditional Statements: if, if-else, if-elif-else

Loops:

- while loop

- for loop

- Loop control: break, continue, pass

Review of Python II

Strings: Immutable, Methods: upper(), lower(), find(), replace(), split(), etc.

Lists: Mutable, Methods: append(), insert(), remove(), sort(), reverse()

Tuples: Immutable, Can contain mixed data types

Review of Python III

Dictionaries: Unordered, mutable key-value pairs

Methods: get(), keys(), values(), items(), pop(), update()

Type Conversion: int(), float(), str(), list()

Intro to Functions (prelude to UDFs)

User Defined Function in Python

Definition: Created using def keyword.

Types:

- Without return value

- With return value

- With/without parameters

Arguments: Positional, Keyword, Default, *args, **kwargs


Python & Networking Notes - Class 12

Scope: Global vs Local variables

File Handling in Python

open(filename, mode): Modes - 'r', 'w', 'a', 'rb', 'wb'

Reading: read(), readline(), readlines()

Writing: write(), writelines()

Closing: file.close()

With statement: with open('file.txt') as f:

Exception Handling in Python

try, except, else, finally blocks

Example:

try:

a = 10 / 0

except ZeroDivisionError:

print("Cannot divide by zero")

finally:

print("Done")

Common Exceptions: ZeroDivisionError, ValueError, IndexError, FileNotFoundError

Data Structure Using Python List

List: Ordered, mutable collection

Operations: Indexing, Slicing, append(), insert(), pop(), remove(), del, index()

Traversal: for item in list

Nested Lists: List within list

Stack Using Python List

LIFO: Last-In-First-Out structure

push: stack.append(item)

pop: stack.pop()

Applications: Undo functionality, expression evaluation


Python & Networking Notes - Class 12

Computer Networking

Definition: Interconnection of computers for sharing data.

Types: PAN, LAN, MAN, WAN

Components: Modem, Router, Switch, Hub

Topology: Bus, Star, Ring, Mesh

Transmission Media: Wired and Wireless

Network Protocol & Application

Protocols: TCP/IP, HTTP/HTTPS, FTP, SMTP, POP3, IP, DNS

IP Addressing: Static and Dynamic, IPv4 & IPv6

Applications: Email, Web browsing, File Sharing, Video Conferencing

You might also like