Program Post Graduate Diploma in Data Science
Semester 1
Subject Code 1618004
and Name Introduction to Python Programming
Credit 5
Objectives
• To write compact codes specifically for programming in Data Analytics, AI and
scientific computing.
• To understand and use various constructs available in python language.
• To understand and apply various functions on file data.
Unit Topic(s) No. of
No. Hours
1. Introduction To Python 2
Installation and Working with Python, Understanding Python variables,
Python basic Operators, Understanding python blocks
2. Python Data Types 4
Declaring and using Numeric data types: int, float, complex, Using string
data type and string operations, Defining list and list slicing, Use of Tuple
data type
3. Python Program Flow Control 8
Conditional blocks using if, else and elif, Simple for loops in python, For loop
using ranges, string, list and dictionaries, Use of while loops in python, Loop
manipulation using pass, continue, break and else, Programming using
Python conditional and loops block
4. Python Functions, Modules And Packages 8
Organizing python codes using functions, Organizing python projects into
modules, Importing own module as well as external modules,
Understanding Packages, Powerful Lamda function in python,
Programming using functions, modules and external packages
5. Python String, List And Dictionary Manipulations 8
Building blocks of python programs, Understanding string in build methods,
List manipulation using in build methods, Dictionary manipulation,
Programming using string, list and dictionary in build functions
6. Python File Operation 6
Reading config files in python, Writing log files in python, Understanding
read functions, read(), readline() and readlines(), Understanding write
functions, write() and writelines(), Manipulating file pointer using seek,
Programming using file operations
7. Python Exception Handling 4
Avoiding code break using exception handling, Safe guarding file operation
using exception handling, Handling and helping developer with error code,
Programming using Exception handling
Page 1 of 3
Reference Books
1. Core Python Programming
by Dr. R. Nageswara Rao
DreamTech, Second edition
2. Core Python Programming
by Wesley J. Chun
Prentice Hall PTR, Second Edition, ISBN-13: 978-0132269933, ISBN-10:
0132269937
3. Data Structures and Algorithms in Python
by Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser
Wiley
4. Fundamentals of Python – First Programs
by Kenneth A. Lambert
CENGAGE Publication, ISBN-13: 978-1111822705, ISBN-10: 1111822700
Outcomes
After completion of subject, students would be able to:
• select and apply the appropriate data structures available in Python
programming language in solving computational problems.
• work on data stored in text files.
Suggested list of Practical (at least 10 practical are to be performed by students.
These practical should cover majority of all topics of syllabus.)
This is the suggested list of practical but it may not be limited only to this list.
1. Print “Hello World” message.
2. Find maximum from 3 given numbers.
3. Print sum of all numbers within given range.
4. Print all prime numbers within given range.
5. Print largest odd number from 10 entered numbers.
6. Print base and power from entered number. If no possibility then appropriate
message should display.
7. Print sum of all decimal numbers from entered a string of numbers separated by
comma.
8. Write a function that demonstrates the use of positional arguments, keyword
arguments and default parameters.
9. Write a function that accepts two strings as arguments and returns TRUE if either
string occurs anywhere in other and FALSE otherwise.
10. Print series of fibonacci numbers upto a given limit using recursion.
11. Print binary equivalent of given decimal number using recursion.
12. Print LCM and GCD of 2 numbers using recursion.
13. Write a function that demonstrates scope of variable in nested functions.
14. Check a given string is palindrome or not using recursion.
15. Reverse the given string using recursion.
16. A program which calculates square root of decimal number using recursive
function and also displays number of times function called.
17. An interactive program where one module asks numbers from user and second
module performs at least six arithmetic operations on them.
18. A program to read the contents of a file.
Page 2 of 3
19. A program to count the number of words, number of lines, occurrence of
particular word, occurrence of particular character, number of blank spaces in a
text file.
20. A program to read a string from the user and append it into a file.
21. A program to copy the contents of one file into another.
22. A program to read a text file and print all the numbers present in the text file.
23. A program to append the contents of one file to another file.
24. A program to read a file and capitalize the first letter of every word in the file.
25. A program to read the contents of a file in reverse order.
26. A program to sort all even numbers and then all odd numbers in given list.
27. A function that takes 2 lists as an argument and returns true if both contains same
elements not necessarily in same order.
28. A function that reads the words in words.txt and stores them as keys in a
dictionary. It doesn’t matter what the values are. Then you can use the in operator
as a fast way to check whether a string is in the dictionary.
29. A function that takes a list as an argument and returns first & last even number.
If only one even number exists or no even number exists, exception is raised.
**********
Page 3 of 3