Programming Logic & Techniques using Python
Course Code: MCA504 • 60 Total Hours (Theory: 3h, Practical: 2h/wk)
This course provides Python-based programming logic and techniques. Python is a fast-growing language integral to finance, web development, research, and data science. Students master fundamentals, data structures, file handling, OOP, GUI, database connectivity, and standard data analysis and visualization libraries.
Unit 1Python Language Basics
Topics Covered
- ▪Introduction to Python, algorithm and flowchart
- ▪Installing Python, interactive shell (REPL), script execution
- ▪Data types, operators, expressions, control structures
- ▪Arrays and collections
- ▪Functions: custom functions, recursion, lambda expressions
- ▪String and numeric conversions (str to int/float and vice-versa)
पाइथनको आधारभूत संरचना, इन्टरप्रेटर कसरी चल्छ, भेरिएबल र डाटा टाइप, लुप तथा फङ्सनका नियमहरू।
C को strict typing र main() function सँग Python को dynamic typing र indentation को फरक बुझ्ने।
Unit 2Data Structure and File Handling
Topics Covered
- ▪List Comprehensions: indexing, slicing, updates, built-in methods
- ▪Dictionary Comprehensions: keys, values, iterations, CRUD operations
- ▪File Handling: os and sys modules, path navigation
- ▪Text files: reading, writing strings and numbers
- ▪Formatted files: CSV and TSV processing
डाटा स्ट्रक्चर (Lists, Dictionaries) को सहज व्यवस्थापन र कम्प्युटर डिस्कबाट फाइल (Text/CSV) पढ्ने र लेख्ने विधि।
C को malloc/free र file pointers (FILE*) को सट्टा Python को automatic memory management र `with open()` syntax।
Unit 3Object-Oriented & GUI Programming
Topics Covered
- ▪Class & Object creation, __init__ constructor, self reference
- ▪Inheritance, abstraction, polymorphism, custom exception handling
- ▪Advanced paradigms: Iterators, Generators (`yield`), and Decorators
- ▪GUI building with Tkinter: components, frames, and event loops
- ▪Widgets: Button, Entry, Frame, Text, Label, Checkbutton, Radiobutton, Listbox, Menu
अब्जेक्ट ओरिएन्टेड प्रोग्रामिङ (क्लास, इन्हेरिटेन्स, पोलिमोर्फिजम), जेनेरेटर र डेकोरेटरको गहिरो बुझाइ तथा Tkinter बाट डेस्कटप एप बनाउने।
C++ वा Java को verbose boilerplate सट्टा Python को clean class syntax र dynamic method dispatch।
Unit 4Database Programming using Python
Topics Covered
- ▪Database connectivity (SQLite / MySQL / PostgreSQL drivers)
- ▪Executing DDL (CREATE, ALTER, DROP) and DML (INSERT, UPDATE, DELETE) queries
- ▪Cursor handling and processing query result sets (fetchone, fetchall)
- ▪Transaction management: Commit and Rollback safety
पाइथनबाट डाटाबेससँग सम्पर्क (Connection) गर्ने, SQL क्वेरी चलाउने र ट्रान्ज्याक्सन (Commit/Rollback) सुरक्षित गर्ने तरिका।
Node.js को async callback/Promise वा C/ODBC सट्टा Python DB-API 2.0 को synchronous & intuitive cursor interface।
Unit 5Basic Data Processing & Analysis using Python Libraries
Topics Covered
- ▪NumPy: environment setup, ndarray creation, attributes, I/O
- ▪NumPy indexing, slicing, broadcasting, statistical & sorting functions
- ▪SciPy: basic functionality, cluster, constants, integrate, interpolate, linalg
- ▪Pandas: Series and DataFrames from lists, dicts, arrays, and files
- ▪Pandas operations: head/tail, missing data imputation, fancy indexing, merge & join
डाटा साइन्सका मेरुदण्ड: NumPy का म्याट्रिक्स र गणना, SciPy को वैज्ञानिक विश्लेषण, र Pandas को DataFrame डाटा क्लिनिङ।
C का multi-dimensional arrays र loops को तुलनामा NumPy को vectorized broadcasting धेरै गुणा छिटो र सरल।
Unit 6Data Visualization with Matplotlib
Topics Covered
- ▪Introduction to Matplotlib and Pyplot API
- ▪Simple plots, multi-plots, figure & axes control
- ▪Subplots() and Subplot2grid() advanced grid layouts
- ▪Formatting axes, labels, legends, limits, and grids
- ▪Plot types: Line, Bar, Scatter, Histogram, Pie Chart, and Box Plot
डाटालाई दृश्यमा उतार्ने कला: लाइन, बार, हिस्टोग्राम, बक्स प्लट र सब-प्लट लेआउट बनाउने विधि।
C वा JS (D3.js / Chart.js) को जटिल DOM setup बिना केवल केही लाइन कोडमै पब्लिकेशन-ग्रेड ग्राफिक्स उत्पादन।