Book Cover
MCA5043 Credits
Tribhuvan University Curriculum

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

16 Hours
Study Guide

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)
नेपाली बुझाइ (Nepali Concept)

पाइथनको आधारभूत संरचना, इन्टरप्रेटर कसरी चल्छ, भेरिएबल र डाटा टाइप, लुप तथा फङ्सनका नियमहरू।

C / JS Developer Bridge

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
नेपाली बुझाइ (Nepali Concept)

डाटा स्ट्रक्चर (Lists, Dictionaries) को सहज व्यवस्थापन र कम्प्युटर डिस्कबाट फाइल (Text/CSV) पढ्ने र लेख्ने विधि।

C / JS Developer Bridge

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
नेपाली बुझाइ (Nepali Concept)

अब्जेक्ट ओरिएन्टेड प्रोग्रामिङ (क्लास, इन्हेरिटेन्स, पोलिमोर्फिजम), जेनेरेटर र डेकोरेटरको गहिरो बुझाइ तथा Tkinter बाट डेस्कटप एप बनाउने।

C / JS Developer Bridge

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
नेपाली बुझाइ (Nepali Concept)

पाइथनबाट डाटाबेससँग सम्पर्क (Connection) गर्ने, SQL क्वेरी चलाउने र ट्रान्ज्याक्सन (Commit/Rollback) सुरक्षित गर्ने तरिका।

C / JS Developer Bridge

Node.js को async callback/Promise वा C/ODBC सट्टा Python DB-API 2.0 को synchronous & intuitive cursor interface।

Unit 5Basic Data Processing & Analysis using Python Libraries

15 Hours
Study Guide

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
नेपाली बुझाइ (Nepali Concept)

डाटा साइन्सका मेरुदण्ड: NumPy का म्याट्रिक्स र गणना, SciPy को वैज्ञानिक विश्लेषण, र Pandas को DataFrame डाटा क्लिनिङ।

C / JS Developer Bridge

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
नेपाली बुझाइ (Nepali Concept)

डाटालाई दृश्यमा उतार्ने कला: लाइन, बार, हिस्टोग्राम, बक्स प्लट र सब-प्लट लेआउट बनाउने विधि।

C / JS Developer Bridge

C वा JS (D3.js / Chart.js) को जटिल DOM setup बिना केवल केही लाइन कोडमै पब्लिकेशन-ग्रेड ग्राफिक्स उत्पादन।