Python Programming (DI02032011)
GUJARAT TECHNOLOGICAL UNIVERSITY
Program Name: Diploma in Engineering
Level: Diploma
Branch: Information & Communication Technology
Course/Subject Code: DI02032011
Course/Subject Name: Python Programming
| w.e.f. Academic Year: | 2024-25 |
|---|---|
| Semester: | 2nd |
| Category of the Course: | PCC |
Prerequisite
Basic computer skills
Rationale
Programming skills using Python Language have become prevalent and increasingly popular in the Information Technology domain. The Python programming language is one of the most popular programming languages worldwide. The Python Programming for Information Communication Technology (ICT) course emphasizes the use of this popular programming platform in multiple domains. Python is a modern language for writing compact codes specifically for programming Server-side web apps, Data Analytics and Machine Learning, an important Artificial Intelligence domain. Furthermore, Python has gained popularity in scientific computing, production tools and game programming. The following course focuses on developing Python Programs for programming tasks where the students are encouraged to create basic applications using different open source tools. At the end of the course, the student will be developing adequate basic programming skills using python language.
Course Outcomes
After completion of the course, students will be able to:
| No. | Course Outcomes | RBT Level |
|---|---|---|
| 01 | Prepare flowchart and algorithm for solving computing problems. | R,U,A |
| 02 | Develop python programs to solve simple problems. | R,U,A |
| 03 | Apply control structure feature of python for developing programs. | R,U,A |
| 04 | Develop Python Programs using built-in functions, modules and libraries | R,U,A |
| 05 | Develop python programs using dictionary, list, string, set and tuple manipulation functions. | R,U,A |
*Revised Bloom's Taxonomy (RBT)
Teaching and Examination Scheme
| Teaching Scheme (Hours) | Credits | Assessment Pattern and Marks | Total | |||||
|---|---|---|---|---|---|---|---|---|
| L | T | PR | C | Theory ESE (E) | Theory PA/CA (M) | Tutorial/Practical PA/CA (I) | Tutorial/Practical ESE (V) | Marks |
| 3 | 0 | 2 | 4 | 70 | 30 | 20 | 30 | 150 |
Course Content
| Unit No. | Content | No. of Hours | % of Weightage |
|---|---|---|---|
| 1 | Problem Solving using Flowchart and Algorithm | 05 | 10 |
| 2 | Introduction to Python | 06 | 14 |
| 3 | Flow of Control | 12 | 23 |
| 4 | Functions | 08 | 20 |
| 5 | Dictionary, List, Set, String and Tuple | 14 | 33 |
| Total | 45 | 100 |
Suggested Specification Table with Marks (Theory)
Distribution of Theory Marks (in %)
| R Level | U Level | A Level | N Level | E Level | C Level |
|---|---|---|---|---|---|
| 22 | 28 | 50 | -- | -- | -- |
Where R: Remember; U: Understanding; A: Application, N: Analyze and E: Evaluate C: Create (as per Revised Bloom's Taxonomy)
References/Suggested Learning Resources
(a) Books
- Learn Programming in Python with Cody Jackson by Cody Jackson, Packt Publishing, 2018, ISBN: 9781789531947
- Python Basics: A Practical Introduction to Python 3 by David Amos, Dan Bader et. al. Real Python, 2021 ISBN: 9781775093329
- Introduction to Problem Solving with Python by E. Balagurusamy Mc Graw Hill India, New Delhi, 2017 ISBN: 9789352602582
- Beginning Python by James Payne, Wiley, 2010 ISBN: 9780470414637
- Think Python by Allen Downey, O'Reilly, USA, 2016, ISBN: 978-9352134755
(b) Open Source Software and Websites
- Python.org
- W3Schools Python Tutorial
- GeeksforGeeks Python Tutorial
- Learn Python
- Hackr.io Python Tutorials
- SoloLearn Python Course
- NPTEL
Suggested Course Practical List
| S. No. | Practical Outcomes (PrOs) | Unit No. | Approx. Hrs. Required |
|---|---|---|---|
| 1 | Prepare flowchart and algorithm for a given problem. (Following are the sample programs. Faculty can select any other similar programs for the practice of the students.) i. Find the sum of two given numbers. ii. Find a maximum out of two given numbers. iii. Find whether a given number is odd or even. iv. Find a maximum out of three given numbers. | I | 02 |
| 2 | a) Write a Program to print your name, mobile number, and date of birth. b) Develop a Program to identify data-types in python. | II | 02 |
| 3 | a) Create a Program to read three numbers from the user and find the average of the numbers. b) Develop a Program that can calculate simple interest and compound interest. | II | 02 |
| 4 | a) Identify whether the scanned number is even or odd and print an appropriate message. b) Create a Program to find a maximum number among the given three numbers. | III | 02 |
| 5 | Develop a Program to demonstrate the basic functionalities of a standard calculator. | III | 02 |
| 6 | a) Write a Python program to print 1 to 10 numbers using loops. b) Write a Program to show whether the entered number is prime or not. | III | 02 |
| 7 | Write a Program to display the following patterns: A) Number patterns: 1, 1 2, 1 2 3, 1 2 3 4, 1 2 3 4 5 B) Star patterns: * * * * *, * * * *, * * *, * *, * | III | 02 |
| 8 | Create a User-defined function to print the Fibonacci series of 0 to N numbers. (Where N is an integer number and passed as an argument) | IV | 02 |
| 9 | a) Develop a User-defined function to find the factorial of a given number. b) Write a Program using the function that reverses the entered value. | IV | 02 |
| 10 | Write a Program that determines whether a given number is an 'Armstrong number' or a palindrome using a user-defined function. | IV | 02 |
| 11 | a) Write a Program to find the length of a string. b) Write a Program to reverse words in a given sentence. c) Write a Program to check if a substring is present in a given string. d) Write a Program to count and display the number of vowels, consonants, uppercase, lowercase characters in a string. | V | 02 |
| 12 | Develop Programs to perform the following list operations: a) To swap given two elements in a list. b) To find the sum of elements in a list. c) To check if an element exists in a given list. d) To find the smallest and largest element in a given list. | V | 02 |
| 13 | a) Given a List saved in variable: a = [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]. Write one line of Python that takes this list and makes a new list that has only the even elements of this list in it. b) Create a List containing the square of all odd numbers from range 1 to 10. c) Create a List of prime and non-prime numbers in range 1 to 50. | V | 02 |
| 14 | a) Write a Program to demonstrate some useful set functions and operations. b) Write a Program to demonstrate some useful Tuple functions and operations. | V | 02 |
| 15 | a) Write a Program to demonstrate the dictionaries functions and operations. b) Create a Dictionary with the roll number, name, and marks of n students in a class and display the names of students who have scored marks above 75. | V | 02 |
| Total | 30 |
Underpinning Theory
Only the major Underpinning Theory is formulated as higher-level UOs of Revised Bloom's taxonomy in order development of the COs and competency is not missed out by the students and teachers. If required, more such higher-level UOs could be included by the course teacher to focus on the attainment of COs and competency.
| Unit | Unit Outcomes (UOs) (4 to 6 UOs at Application and above level) | Topics and Sub-topics |
|---|---|---|
| Unit - I: Problem Solving using Flowchart and Algorithm | 1.1 Explain steps to solve a problem. 1.2 Draw flowchart of given problem based on sequence, selection, repetition. 1.3 Write pseudocode for the given problems. | 1.1.1 Introduction, Steps for problem-solving, Algorithm and its characteristics, Importance of flowchart and algorithm 1.2.1 Symbolic representation of a flowchart, Limitations of flowchart Flow of control 1.3.1 Problem solving using pseudocode |
| Unit - II: Python Introduction | 2.1 Explain the given features and applications of python. 2.2 Install the latest version of python 2.3 Apply given keywords, identifiers, variables, data types, and operators in python programs. 2.4 Write pseudocode for the explicit and implicit type conversion. | 2.1.1 Introduction to python, Python features, Applications of python programming 2.2.1 Python installation 2.3.1 Basic structure of python program, Keywords, identifiers, and variables, Data types, Operators 2.4.1 Type Conversion |
| Unit - III: Flow of Control | 3.1 Classify control structure. 3.2 Write pseudocode for the flow of control using different selection types. 3.3 Write pseudocode for the flow of control using different repetition types. 3.4 Implement break and continue statements in the python program. | 3.1.1 Introduction to Flow of Control 3.2.1 Selection: - If statement - Elif statement - Nested if statement 3.3.1 Repetition: - For loop - While loop - Nested loop 3.4.1 Break and Continue Statements |
| Unit - IV: Functions | 4.1 Write pseudocode for user-defined functions. 4.2 Apply Global and Local variable concepts in python program. 4.3 Use built-in functions and modules. | 4.1.1 Introduction to Functions: - User Defined Functions - Arguments and Parameters 4.2.1 Scope of a Variable: - Global Variable - Local Variable 4.3.1 Python Standard Library: - Built-in functions - Input or output: input(), print() - Mathematical Functions: abs(), divmod(), max(), min(), pow(), sum() - Modules: math, random, statistics |
| Unit - V: Dictionary, List, Set, String and Tuple | 5.1 Use of string operations in python programs. 5.2 Use built-in functions for string manipulation. 5.3 Write pseudocode for list operations. 5.4 Use built-in functions for list manipulation. 5.5 Use built-in functions for Set manipulation. 5.6 Use of Tuple operations in python programs. 5.7 Use built-in functions for Dictionary manipulation. | 5.1.1 Introduction to String, String Operations, Traversing a String 5.2.1 String Methods and Built-in Functions 5.3.1 Introduction to List and its Operations 5.4.1 List Methods and Built-in Functions 5.5.1 Set Built-in Functions - Create a Set, Accessing Python Sets - Delete from set, Update set 5.5.2 Python Set Operations 5.6.1 Tuple Built-in Functions - Creating Tuples - Accessing Tuple - Iterate over tuple and Slicing tuple 5.6.2 Python Tuple Operations, Functions and Methods 5.7.1 Dictionary Built-in Functions - Creating Dictionary, Accessing Items - Add, Update, Remove in Dictionary 5.7.2 Built-In Dictionary Methods and functions |
List of Laboratory/Learning Resources Required
| S. No. | Equipment Name with Broad Specifications | PrO. No. |
|---|---|---|
| 1 | Computer system with operating system: Windows 7 or higher Ver., macOS, and Linux, with 4GB or higher RAM, Python versions: 2.7.X, 3.6.X | All |
| 2 | Python IDEs and Code Editors Open Source: IDLE, Jupyter | 2 to 8 |
Suggested Project List
Only one micro-project is planned to be undertaken by a student that needs to be assigned to him/her in the beginning of the semester. In the first four semesters, the micro-project are group-based. However, in the fifth and sixth semesters, it should be preferably be individually undertaken to build up the skill and confidence in every student to become problem solver so that s/he contributes to the projects of the industry. In special situations where groups have to be formed for micro-projects, the number of students in the group should not exceed three. The micro-project could be industry application based, internet-based, workshop-based, laboratory-based or field-based. Each micro-project should encompass two or more COs which are in fact, an integration of PrOs, UOs and ADOs. Each student will have to maintain a dated work diary consisting of individual contributions in the project work and give a seminar presentation of it before submission. The total duration of the micro-project should not be less than 16 (sixteen) student engagement hours during the course. The student ought to submit a micro-project by the end of the semester to develop the industry oriented COs.
A suggestive list of micro-projects is given here. This has to match the competency and the COs. Similar micro-projects could be added by the concerned course teacher:
- Case Study 1: Compare three various tools functionality for python programming in the ICT domain
- Case Study 2: List out features of latest python version and compare with older two different versions.
- Case Study 3: Study math and random module of python and explain real life usage with examples. List their importance in Information Communication Technology