National Institute of Technology Rourkela

राष्ट्रीय प्रौद्योगिकी संस्थान राउरकेला

ଜାତୀୟ ପ୍ରଯୁକ୍ତି ପ୍ରତିଷ୍ଠାନ ରାଉରକେଲା

An Institute of National Importance

Syllabus

Course Details

Subject {L-T-P / C} : PH4073 : Computer Programming Laboratory { 0-0-3 / 2}

Subject Nature : Practical

Coordinator : Jyoti Prakash Kar

Syllabus

Module 1 :

Module 1: (6 hours)
Setting up Python environment and learn how to use it. Handling strings, input() and print() statements. Variables, assignment, and string concatenation. Introduction to List methods, List slicing, and IF/ELSE constructs.

Module 2: (6 hours)
Introduction to FOR loop. FOR loop with IF/ELSE statement. Handling integer, floats, and introduction to arithmetic operations. Introduction to the Python module RANDOM, finding the probability distribution of the outcomes of throwing two or more dice.

Module 3 (6 hours)
The WHILE loop and the logical operators AND, OR, NOT, NOT IN. Introduction to the data type Boolean. Lists and arithmetic operations, nested FOR loops, list FLATTENING.

Module 4: (9 hours)
Introduction to the data type DICTIONARY and list of dictionaries. Application of dictionaries. User defined FUNCTION and DATABASE creation.

Module 5: (9 hours)
Working with files: reading from a file, working with a file’s contents, writing to a file , storing data. Creating and using a CLASS.

Course Objective

1 .

To familiarize students with the Python programming, including variables, strings, lists, and control flow structures.

2 .

To develop problem-solving skills using loops (FOR and WHILE) and logical operators.

3 .

To introduce fundamental data structures like lists and dictionaries, and their practical applications in data handling and storage.

4 .

To provide hands-on experience with object-oriented programming concepts, file handling, and database creation in Python.

Course Outcome

1 .

At the end of the course, students will be able to:
CO1: Set up a Python environment and effectively use basic programming constructs.

CO2: Demonstrate proficiency in using loops (FOR, WHILE) and conditional statements.

CO3: Implement Python's built-in data structures and apply them in real-world scenarios.

CO4: Gain the ability to design user-defined functions, create and use classes, and manage file operations.

Essential Reading

1 .

S. Bonaretti, Learn Python with Jupyter, www.learnpythonwithjupyter.com.

2 .

E. Matthes, Python Crash Course, No Starch Press (2023).

Supplementary Reading

1 .

A. Sweigart, Automate the Boring Stuff with Python, No Starch Press (2024).

2 .

A. B. Downey, Think Python, O’Reilly (2024).