0% found this document useful (0 votes)
52 views2 pages

Python Programming Course Outline

The document outlines a course on Python programming as part of a Bachelor with Computer Applications major, detailing learning outcomes, course content, and lab work. Key topics include programming fundamentals, data structures, object-oriented concepts, file operations, and using libraries like Numpy and Pandas. It also lists textbooks and reference materials for further study.

Uploaded by

hayaazad760
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)
52 views2 pages

Python Programming Course Outline

The document outlines a course on Python programming as part of a Bachelor with Computer Applications major, detailing learning outcomes, course content, and lab work. Key topics include programming fundamentals, data structures, object-oriented concepts, file operations, and using libraries like Numpy and Pandas. It also lists textbooks and reference materials for further study.

Uploaded by

hayaazad760
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

BACHELOR WITH COMPUTER APPLICATIONS AS MAJOR (CT-1)

6th SEMESTER
CAP622J1: COMPUTER APPLICATIONS _ PYTHON PROGRAMMING
CREDITS: THEORY (3) PRACTICAL (1)
LEARNING OUTCOMES:
After completing this course, the learner shall be able to:
1. Understand the fundamentals of programming through Python
2. Transform a solution from a subjective world into an objective world.
3. Work with and manipulate different basic data structures available in Python
4. Use the List comprehensions and generators in their programs
5. Apply basic object-oriented concepts to design classes and objects in Python
6. Use concepts of Inheritance and Polymorphism in their programs
7. Perform basic file operations for text and CSV files
8. Use existing inbuilt Python modules
9. Develop custom modules
10. Use basic functionalities provided by packages Numpy and Pandas
11. Develop visualizations using different plotting functions available in matplotlib

UNIT-I: (15 LECTURES)


Origins and History of Python, Structure of a Python Program, Interpreter shell, Indentation, Comments,
Identifiers and keywords, Literals, Basic operators (Arithmetic operator, Relational operator, Logical or
Boolean operator, Assignment Operator, Bit wise operator)
Entering Expressions into the Interactive Shell, The Integer, Floating-Point, and String Data Types, String
Concatenation and Replication, Storing Values in Variables. Creating Python Programs: Input and Output
Statements, Control statements: -branching, looping, range function, Exit function, break, continue and pass.

UNIT: II (15 LECTURES)


Functions: Defining a Function, Calling a Function, def Statements with Parameters, Formal and Actual
Arguments, Positional Arguments, Keyword Arguments, Default Arguments, Variable Length Arguments,
Return Values and return Statements, The None Value, Local and Global Scope, The global Statement.
The List Data Type: Creating Lists, Basic List Operations, Indexing and Slicing in Lists, Built-In Functions
Used on Lists, List Methods. List comprehension.

UNIT: III (15 LECTURES)


The Dictionary Data Type: Creating Dictionary, Accessing and Modifying key: value Pairs in Dictionaries,
Built-In Functions used on Dictionaries, Dictionary Methods
Tuples and Sets, Creating Tuples, Basic Tuple Operations, Indexing and Slicing in Tuples, Built-In
Functions Used on Tuples, Set Methods, Traversing of Sets
Strings, Creating and Storing Strings, Basic String Operations, Accessing Characters in String by Index
Number, String Slicing and Joining, String Methods, Formatting Strings.
Files: Types of Files, Creating and Reading Text Data

TEXT BOOKS
1. Gowrishankar S, Veena A, “Introduction to Python Programming”, 1st
Edition, CRC Press/Taylor & Francis, 2018. ISBN-13: 978-0815394372
2. Downey, A.B., (2015), Think Python How to think like a Computer Scientist, 3rd edition.
3. Taneja, S. & Kumar, N., (2017), Python Programming- A Modular Approach. Pearson Education.

REFERENCE BOOKS
1. Jake VanderPlas, “Python Data Science Handbook: Essential Tools for Working with Data”, 1st
Edition, O'Reilly Media, 2016. ISBN-13: 978-1491912058
2. Aurelien Geron, “Hands-On Machine Learning with Scikit-Learn and TensorFlow: Concepts, Tools,
and Techniques to Build Intelligent Systems”, 2nd Edition, O’Reilly Media, 2019. ISBN – 13: 978-
9352139057.
3. Wesley J Chun, “Core Python Applications Programming”, 3rd Edition, Pearson Education India, 2015.
ISBN-13: 978-9332555365
4. Miguel Grinberg, “Flask Web Development: Developing Web Applications with Python”, 2nd Edition,
O'Reilly Media, 2018. ISBN-13: 978-1491991732.
5. Brown, M. C. (2001). The Complete Reference: Python, McGraw Hill Education.
6. Dromey, R. G. (2006), How to Solve it by Computer, Pearson Education.
7. Guttag, J. V. (2016), Introduction to computation and programming using Python. MIT Press.
8. Liang, Y.D. (2013), Introduction to programming using Python. Pearson Education.

LAB WORK: PYTHON PROGRAMMING


1. Install and configure Python IDE
2. Write simple Python program to display message on screen
3. Write a program to demonstrate different number data types & arithmetic operations in Python.
4. Write a Python program to demonstrate use of conditional statements:
5. Write Python program to demonstrate use of looping statements
6. Demonstrate the following control transfer statements in Python with suitable examples.
i) break
ii) continue
iii) pass
7. Write a python program to demonstrate the working of following functions in Python.
i) id( )
ii) type( )
iii) range( )
8. Write Python programs to demonstrate the following:
i) input( )
ii) print( )
iii) ‘sep’ attribute
iv) ‘end’ attribute
9. Write a program to create a menu driven program with the following options using functions:
Addition 2. Subtraction 3. Multiplication 4. Division
10. Write Python program to perform following operations on Lists:
a) Create list
b) Access list
c) Update list (Add item, Remove item)
d) Delete list
11. Write Python program to perform following operations on Tuples:
a) Create Tuple
b) Access Tuple
c) Update Tuple
d) Delete Tuple
12. Write Python program to perform following operations on Sets:
a) Create Set
b) Access Set elements
c) Update Set
d) Delete Set
13. Write Python program to perform following operations on Dictionaries:
a) Create Dictionary
b) Access Dictionary elements
c) Update Dictionary
d) Delete Set
e) Looping through Dictionary
14. Write a Python program to demonstrate slicing operations on lists and strings.
15. Write a Python program to perform read and write operations on a file.

Common questions

Powered by AI

NumPy and Pandas greatly enhance data analysis capabilities in Python by addressing limitations of basic lists and dictionaries. NumPy provides support for large, multi-dimensional arrays and matrices, along with a wide variety of mathematical functions to perform operations on these data structures. This enables handling of large datasets with high efficiency and performance. Pandas, on the other hand, extends data manipulative tasks through easy-to-use data frames and series, providing functionalities like data alignment, missing data handling, and group operations. Together, they form the backbone of data manipulation and analysis in Python, allowing for more robust data science workflows .

List comprehensions in Python provide a concise and readable way to create lists. They combine the creation of a new list with a for loop, often including a condition to filter elements. This improves efficiency as it typically requires fewer lines of code than traditional loops and makes it easier to understand the transformation being applied to list elements. The result is code that is cleaner, faster to write, and executes more efficiently, as Python optimizes the list comprehension process .

The global statement in Python alters the scope of variables, making it possible to access or modify variables declared outside the current function. While this can simplify the manipulation of global state variables, it introduces risks and challenges in program stability and maintenance. Using global variables increases the coupling between functions, making tracking changes more difficult and potentially leading to unexpected side effects. This can cause issues in debugging and can lead to bad software design practices if overused. Therefore, careful consideration should be given to the use of the global statement, preferring function parameters and return values to pass data explicitly instead .

Python's built-in string functions generally offer superior performance and functionality compared to custom-written ones because they are implemented in C and are highly optimized for various operations. Built-in functions like join(), split(), and format() are designed to handle string operations with high efficiency and cover a wide range of use cases, providing optimized solutions that would be costly to recreate manually. These functions are also regularly updated and maintained by the community, ensuring reliability and security, which is challenging to achieve in bespoke implementations. Thus, for most tasks, relying on built-in string functions is preferred for both performance and ease of use .

Ensuring maintainability and scalability in Python codebases involves applying principles of modular programming, where code is divided into self-contained modules. This approach promotes reuse and ease of debugging, as individual modules can be developed and tested independently. Modules encapsulate functionality and promote clean API interfaces, allowing the rest of the codebase to interact with them through clearly defined methods. Techniques such as using namespaces to avoid naming conflicts, leveraging Python's ability to import modules across projects, and adhering to consistent coding standards further ensure long-term maintainability. This modularity is foundational for scaling complex Python projects efficiently .

Python's built-in functions and modules, such as open(), read(), and write(), offer a straightforward and efficient way to handle files. They allow easy management of file I/O operations by abstracting complex C-level details, which enhances developer productivity and reduces errors. For handling CSV files specifically, Python provides the 'csv' module, which can read and write tabular data with ease, supporting varied delimiters, quoting styles, and ease of iteration over rows. This streamlined approach is crucial for data analysis tasks, where CSV files are commonly used to export and import datasets .

Generators in Python offer a powerful means to handle large datasets because they generate values on-demand and do not store the entire dataset in memory. This leads to significant memory usage reduction, especially when dealing with large data or streams. However, this comes with trade-offs such as a potential increase in execution time, as the generator must yield items one-by-one. Additionally, generators are iterated only once, which means that the data needs to be stored in another structure if it is to be accessed multiple times. Despite these challenges, the benefits of memory efficiency and the ease of implementation make generators advantageous in many large-scale data scenarios .

Object-oriented programming (OOP) in Python allows developers to design software that models real-world objects. By using classes and objects, software becomes more modular, reusable, and easier to maintain. OOP supports encapsulation, which means data and methods can be bundled together in classes, reducing complexity and improving code clarity. Inheritance allows a class to derive properties and methods from another class, promoting code reuse and the creation of hierarchical structures. Polymorphism enables the development of interfaces and allows objects to be treated as instances of their parent class, thus enhancing flexibility and integration of new features .

Understanding Python's data types and structures allows programmers to optimize program efficiency and data handling. Lists provide flexibility for ordered collections that can be modified, while dictionaries offer fast lookup capabilities for data stored as key-value pairs. Tuples, being immutable, ensure data integrity for collections that should not change. Each structure is optimized for specific use cases: lists for sequential data, dictionaries for associative arrays, and tuples for immutable sequences. By leveraging the strengths of each, developers can write code that is both performant and easy to manage .

Control statements in Python, such as if-else branches, loops (for and while), and control transfer statements (break, continue, and pass), allow for sophisticated management of program flow. Conditional statements enable decision-making, allowing certain blocks of code to be executed based on specific conditions, making the software responsive to different inputs. Loops facilitate iteration, enabling repeated execution of code blocks, which is essential when working with large datasets or performing repetitive tasks. Together, these control structures help increase the efficiency, readability, and functionality of Python programs .

You might also like