Information Booklet cum Syllabus
Of
Python Programming
Revision-I
February 2023
National Institute of Electronics and Information Technology
An Autonomous Scientific Society under
Ministry of Electronics and Information Technology, Government of India
NIELIT Gorakhpur
M.M.M.U.T. Campus, Deoria Road
Gorakhpur (U.P.) -273010
National Institute of Electronics and Information Technology
Basic Python Course
CONTENTS
Sl. No. Title Page No.
1. About the course 2
2. NIELIT 2
3. Objective of Course 2
4. Job Role of Course 3
5. Eligibility 3
6. Duration of Course 3
7. Practical/ Tutorial 3
8. Course Details 3-5
9. Reference Books / Study Material 5
10. Practical Assignments 6-8
11. Sample Questions 8-9
Page No.
1
National Institute of Electronics and Information Technology
Basic Python Course
1. About Course
This course is designed to provide acquire the Knowledge of Python Programming, after
the course students will be able to: Build basic programs using fundamental programming
constructs like variables, conditional logic, looping, functions Lambda Function,
Sequence Data type, File handling, NumPy, OOPs Concepts. Work with user input to
create fun and interactive programs.
2. NIELIT
National Institute of Electronics and Information Technology, NIELIT, (Erstwhile
DOEACC Society) is an autonomous scientific society of the Ministry of Electronics &
Information Technology, Government of India. The Society is registered under the
Societies Registration Act, 1860. NIELIT was set up to carry out Human Resource
Development and related activities in the area of Information, Electronics &
Communications Technology (IECT). NIELIT is engaged both in Formal & Non-Formal
Education in the areas of IECT besides development of industry oriented quality
education and training programmes in the state-of-the-art areas. NIELIT has endeavored
to establish standards to be the country’s premier institution for Examination and
Certification in the field of IECT. It is also one of the National Examination Body, which
accredits institutes/organizations for conducting courses in IT and Electronics in the non-
formal sector.
3. Objective of Course
Python is the fastest growing programming language globally, mainly due to its
simplicity and large community. Python is easy to use, powerful and versatile
programming language, making it a great choice for programmer/developer. This course
introduces programming and the Python language. Students are introduced to core
programming concepts and the course content theory and practical both so that students
understand concept and code to implement the program in a organized way. Also various
tools available for writing and running Python programs with coding examples and
assignments..
After completing the module, the learner will be able to:
• Understand the python Language and describe its features.
• Understand the concept of Python Program and make program by using Control
Structure.
• Able to understand the User Defined Function and create the UDF.
• Able to understand Sequence Data Type (List, Tuple, Set and Dictionary).
• Understand the File Handling in Python.
• Able to understand NumPy in python.
• Understand the concept of OOPs.
Page No.
2
National Institute of Electronics and Information Technology
Basic Python Course
4. Job Roles of Course
After successful completion of the qualification the candidates shall be employed in the
industries for following occupations:
• Assistant Programmer
• Training/Faculty
• And also make Career in Machine Learning/AI
5. Eligibility
12th Pass, Basic Knowledge of Computer.
6. Total duration of the Course
60 Hours (Theory: 24 Hrs, Practical/Tutorial: 36 Hrs)
7. Course Details
7.1. Course Outline and Objective of Each Unit
S. Unit Name Duration Duratio Total Learning Objectives
No. (Theory) n Learni
in Hours (Practic ng
al) in Hrs.
Hours
1 Introduction 2 2 4 After completion of this unit of
to Python module, Learner will be able to
Programming • Understand Basic of
Python Programming
Compare it’s with other
programming language
understand Data type.
• Installation of Python.
• Able to make Program by
accepting user input.
Page No.
3
National Institute of Electronics and Information Technology
Basic Python Course
2 Operators, 3 3 6 After completion of this unit of
Expression in module, Learner will be able to
Python • Understand the
Operators and
expressions in Python
Programming.
• Able to make Program by
using different types of
operator in python
programming.
3 Python 3 6 9 After completing this unit,
Statements Learner will be able to understand
(Conditional • Able to make Program by
statement, using conditional
Looping Statement
statement, • Understand the concept of
break
Loop, Nested Loop and
statement,
able to make program
continue
statement & Based on loop & nested
pass loop.
statement)
4 Sequence 3 5 8 After completing this unit,
Data Types Learner will be able to understand
(List, Tuple, • Know very well what
Set & Sequence Data type is and
Dictionary) how to use it.
• Able to make program by
using Sequence Data type
5 String 2 1 3 After completing this unit,
Handling in Learner will be able to understand
Python • String in Python.
6 Functions 4 6 10 After completing this unit,
(Types of Learner will be able to understand
functions, • User Defined Function
return and Lambda Function
statement, • Understand the concept of
Types of arguments.
arguments, • Understand the concept of
concepts of local & global variables.
local & • Able to make program by
global using recursion.
variable,
recursion)
Page No.
4
National Institute of Electronics and Information Technology
Basic Python Course
7 File 2 4 6 After completing this unit,
input/output Learner will be able to understand
operations • Able to read/write data
from a file.
8 Built-in 2 2 4 After completing this unit,
Modules, Learner will be able to understand
Import • Understand the concept of
statement, Built in Module.
Packages, • Able to use different
Date and Time inbuilt module
Module
9 Introduction 2 2 4 After completing this unit,
to NumPy Learner will be able to understand
• Understand the concept of
NumPy.
• Able to use inbuilt
methods of NumPy.
10 OOPs 2 4 6 After completing this unit,
Concepts Learner will be able to understand
• Concept OOPs.
• Understanding Class and
object.
• Features of OOPs like
Inheritance,
Constructor/Destructor
and polymorphism.
• Understanding types of
Error and Handling
runtime error.
25 35 60
Page No.
5
National Institute of Electronics and Information Technology
Basic Python Course
7.2. Detailed Syllabus
Unit Name Contents Hrs.
Introduction to Python • Introduction, Applications, Diff. b/w C and 04
Programming Python.
• Python Virtual Machine (PVM), Installation,
Execution of program
• Managing Input and Output with examples
Operators, Expressions in • Operators, Data types, Literals, Constants, 06
Python Identifiers, Naming Conventions with examples
Python Statements • Concept of Indentation and if, if...else, 09
(Conditional statement, if…elif…else statement with examples
Looping statement, break, • While loop, for loop, range () function, break
continue and pass and continue, pass & return statements.
statement) • Nesting of loops
Sequence Data Types • List, Tuples 08
(List,Tuples,Set and • Sets, Dictionary
Dictionary)
String Handling in Python • String Handling in Python. 03
Function (Types of • Concept of Functions with Examples 10
functions, return • Anonymous functions (Lambda Function),
statement, Types of Recursive Functions.
arguments, concepts of • Built-in Modules, Import statement,
local and global Packages, Date and Time Modules
variables, recursion)
File input/output • Introduction to File Handling, File 06
operations Operations.
Built-in Modules, • Built in Module. 04
Import statement, • Different inbuilt module
Packages, Date and
Time Module
Introduction to NumPy • Understand the concept of NumPy. 04
• Inbuilt methods of NumPy.
OOPs Concepts • Object Oriented Programming Concepts 06
• Classes and Objects, Encapsulation
Constructor, Destructor and Inheritance
Page No.
6
National Institute of Electronics and Information Technology
Basic Python Course
8. Reference Books/Study Material
• Python Programming Python Programming for Beginners By By Adam Stewart
• Python Cookbook By David Beazley and Brian K. Jones
• Introduction to Python Programming By Gowrishankar S. Veena A.
Page No.
7
National Institute of Electronics and Information Technology
Basic Python Course
9. Practical Assignments
Assignment 1.
Installation of Python IDLE Environment
• Write a program to print "Hello, This is My First Python Program".
• Python Program to read two numbers and print their quotient and remainder.
• Python Program to take the temperature in Celsius and convert it to Fahrenheit.
• Python Program to read height in centimeters and then convert the height to feet and
inches
• Python program to add two numbers.
• Python Program to print odd numbers within a given range.
• Python Program for Program to find area of a circle.
• Python Program for Simple interest calculation.
• Python program to reverse three digits number without using loop.
• Python program to exchange the values of two numbers without using a temporary
variable.
• Python program to calculate gross salary where gross salary=Basic+HRA+DA
o In this HRA is 16% of Basic, DA is 12% of Basic
Assignment 2.
• Write a Python program to find maximum between two numbers using if else.
• Write a program to find maximum among three number
• Python Program to Take in the Marks of 5 Subjects and Display the Grade.
• Python Program to check Armstrong Number use three digit number.
• Write a Python program to check whether a number is positive, negative or zero.
Page No.
8
National Institute of Electronics and Information Technology
Basic Python Course
Assignment 3.
• Python program to calculate factorial of a given number
• Python Program to find the sum of digits in a number.
• Python Program to count the number of digits in a number.
• Python Program for n-th Fibonacci number.
Assignment 4.
• Create a function to calculate the area of Circle.
• Create a function to find out factorial of a number.
• Create a function to find the reverse of a number.
• Create a function to calculate the arithmetic operation.
Assignment 5.
• Program to Find Out Length of String.
• Python program to Check Palindrome of string.
• Program to count No. of vowels of string.
• By using String Function Count a substring in main string
Assignment 6.
• Create a lambda Function to calculate remainder.
• Find the Square of a number by using lambda function.
• Program to add number from 1 to 6 by using Function recursion.
• Program to Calculate Factorial Value By Using Recursion Function.
Assignment 7.
• Program to check the file is Exist or not.
• Program to Read text from File. (File Must be created before reading) at default location.
• Write a program to save the output of program in a file.
• Create a file By using w mode.
• Create a Program to Writing in file using writelines function.
Page No.
9
National Institute of Electronics and Information Technology
Basic Python Course
Assignment 8.
• Create an array using NumPy.
• Find the dimension of array using NumPy inbuilt methods.
Assignment 9.
• Create a Program to calculate sum of two numbers by Using OOPs Concept.
• Create a constructor to take input as a Function.
• Create a class that derived from base class by using derived class object access the base class
method.
Assignment 10.
• Create a Program to Handle Exception
• Create a program to make your own exception class.
• Create a Program to explain try, except and finally method.
Sample Questions:
1. Python was created by .
a. James Gosling b. Bill Gates
c. Steve Jobs d. Guido van Rossum
2. Which of the following is an invalid variable?
a. my_string_1 b. 1st_string
c. foo d. _
3. The && and || operators
a. Compare two numeric values b. Combine two numeric values
c. Compare two Boolean values d. Combine two Boolean values
4. What will be the output of the following Python code?
True = False
while True:
print(True)
break
a. True b. False
c. None d. Yes
5. Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1]?
a. [2,33,222,14] b. Error
c. 25 d. [25,14,222,33,2]
6. What is a variable defined inside a function referred to as?
a. A static variable b. A global variable
c. A local variable d. An automatic variable
Page No.
10
National Institute of Electronics and Information Technology
Basic Python Course
7. random() function will give values between
a. 1 to 10 b. 1 to -1
c. 1 to 20 d. 0 to 1
8. Which function is used to close a file in python?
a. close() b. stop()
c. end() d. close file()
9. represents an entity in the real world with its identity and behaviour.
a. A method b. An object
c. A class d. An operator
10. To determine in which order Python should access namespace, you can use the:
a. LEGB rule b. LGBE rule
c. LBGE rule d. LGEB rule
Page No.
11