Scripting Language - Python Course Code: 4330701: Page 1 of 16
Scripting Language - Python Course Code: 4330701: Page 1 of 16
1. RATIONALE
Python is an open-source, high-level, general-purpose programming language used for
software development. It is one of the most popular programming languages in the world
today and known for its simplicity as well as rich library. It is widely used programming
language in various domains, such as Automation, Server-side Web Development, Tools
Development, Game Programming, Blockchain, Data Science, Artificial Intelligence, Machine
Learning, Big Data etc. It’s relatively easy to learn to use and incredibly versatile.
This course aims to teach the basics of Python programming. The course focuses on how to
use the building blocks of Python programming to solve different problems. At the end of the
course, students will be able to develop simple applications using Python programming. This
knowledge will provide a solid foundation for exploring advanced applications of Python
programming in the different domains mentioned above.
2. COMPETENCY
The course content should be taught and implemented with the aim of developing different
types of skills so that students are able to acquire the following competencies:
● Develop simple applications using scripting language Python.
3 - 4 5 30 70 25 25 150
(*): Out of 30 marks under the theory CA, 10 marks are for assessment of the micro-project to
facilitate integration of COs and the remaining 20 marks is the average of 2 tests to be taken
during the semester for the assessing the attainment of the cognitive domain UOs required for
the attainment of the COs.
Legends: L-Lecture; T – Tutorial/Teacher Guided Theory Practice; P - Practical; C – Credit, CA -
Continuous Assessment; ESE - End Semester Examination.
Environment Setup
1 Install and configure the Python environment. Run basic Python 1 02
commands to verify the Python environment.
Input-Output
2 Write a program to read your name, contact number, email, and 1 02
birthdate and print those details on the screen.
Approx.
S. Unit
Practical Outcomes (PrOs) Hrs.
No. No.
required
Decision-Making Structures
i. A year is a Leap year if it is divisible by 4, unless it is a
century year that is not divisible by 400 (1800 and 1900 are
not leap years, 1600 and 2000 are leap years). Write a
program that calculates whether a given year is a leap year
or not.
ii. Many companies pay time-and-a-half for any hours worked
above 40 hours in a given week. Write a program to input
the number of hours worked and hourly rate and calculate
the total wages for the week.
4 2 04
iii. The Body Mass Index (BMI) is calculated as a person's
weight (in kg), divided by the square of the person's height
(in meters). If the BMI is between 19 and 25, the person is
healthy. If the BMI is below 19, then the person is
underweight. If the BMI is above 25, then the person is
overweight. Write a program to get a person's weight (in
kgs) and height (in cms) and display a message whether the
person is healthy, underweight or overweight.
𝑊𝑒𝑖𝑔ℎ𝑡 𝑖𝑛 𝑘𝑔
𝐵𝑀𝐼 =
(𝐻𝑒𝑖𝑔ℎ𝑡 𝑖𝑛 𝑚)2
Approx.
S. Unit
Practical Outcomes (PrOs) Hrs.
No. No.
required
Loops
i. Write a program to read n numbers from users and calculate
the average of those n numbers.
ii. Write a program that prompts the user to enter 10 integers
and displays all the combinations of picking two numbers
from the 10.
iii. Write programs to print below patterns:
* 1
* * 12
* * * 123
* * * * 1234
* * * * * 12345
5 2 06
iv. Write a program that displays an ASCII character table from
! to ~. Display the ASCII value of a character in decimal and
hexadecimal. Display five characters per line.
v. Write a program to sum the following series:
1 3 5 7 9 11 95 97
+ + + + + +⋯ + +
3 5 7 9 11 13 97 99
vi. A positive integer is called a perfect number if it is equal to
the sum of all of its positive divisors, excluding itself. For
example, 6 is the first perfect number, because 6 = 3 + 2 + 1,
the next is 28 = 14 + 7 + 4 + 2 + 1. There are four perfect
numbers that are less than 10,000. Write a program to find
these four numbers.
Lists
i. Write a program to perform the below operations on the
list:
Create a list.
Add/Remove an item to/from a list.
Get the number of elements in the list.
6 Access elements of the list using the index. 3 05
Sort the list.
Reverse the list.
ii. Write a program to read n numbers from a user and print:
● Number of positive numbers.
● Number of negative numbers.
● Number of zeros.
Approx.
S. Unit
Practical Outcomes (PrOs) Hrs.
No. No.
required
Approx.
S. Unit
Practical Outcomes (PrOs) Hrs.
No. No.
required
Function
i. Write a program that defines a function (shuffle) to
scramble a list into a random order, like shuffling a deck of
cards.
ii. Write a program that defines a function to return a new list
by eliminating the duplicate values in the list.
iii. Write a program to print Fibonacci sequence up to n
numbers using recursion. Fibonacci sequence is defined as
below:
𝐹𝑖𝑏𝑜𝑛𝑎𝑐𝑐𝑖 𝑆𝑒𝑞𝑢𝑒𝑛𝑐𝑒 = 1 1 2 3 5 8 13 21 …
Modules
i. Write a program that defines functions (mean and
deviation), that computes mean and standard deviation of
given numbers. The formula for the mean and standard
9 deviation of n numbers is given as: 4 06
𝑛
𝑥1 + 𝑥2 + ⋯ + 𝑥𝑛
𝑚𝑒𝑎𝑛 = ∑ 𝑥𝑖 =
𝑛
𝑖=1
Approx.
S. Unit
Practical Outcomes (PrOs) Hrs.
No. No.
required
∑𝑛𝑖=1(𝑥𝑖 − 𝑚𝑒𝑎𝑛)2
𝑑𝑒𝑣𝑖𝑎𝑡𝑖𝑜𝑛 = √
𝑛−1
String Processing
i. Write a program to check whether a given string is
palindrome or not.
ii. Write a program to read a string containing letters, each of
which may be in either uppercase or lowercase, and return a
tuple containing the number of vowels and consonants in the
string.
iii. Write a program to read a date in the format DD/MM/YYYY
10 and print the same date in MM-DD-YYYY format. 5 06
iv. Write a program that checks whether two words are
anagrams.
Two words are anagrams if they contain the same letters. For
example, silent and listen are anagrams.
v. Write a program that allows users to enter six-digit RGB color
codes and converts them into base 10. In this format, the first
two hexadecimal digits represent the amount of red, the
second two the amount of green, and the last two the
Approx.
S. Unit
Practical Outcomes (PrOs) Hrs.
No. No.
required
File Handling
i. Write a program to perform the below operations on files:
Create a text file and write a string to it.
Read an entire text file.
Read a text file line by line.
Write a string to a file.
Write a list of strings to a file.
Count the number of lines, words in a file.
ii. Write a program that reads a text file and counts the
occurrences of each alphabet in the file. The program should
prompt the user to enter the filename.
iii. Write a program that reads a text file and displays all the
11 numbers found in the file. 5 06
iv. Write an automated censor program that reads the text from
a file and creates a new file where all of the four-letter words
have been replaced by “****”. You can ignore punctuation,
and you may assume that no words in the file are split across
multiple lines.
v. Write a program that reads a text file and calculates the
average word length and sentence length in that file.
vi. Write a program that reads two strings stored in two different
text files and prints a string containing the characters of each
string interleaved. Remove white spaces from both strings
before string interleaving. For example, Two strings “Hello
World” and “Sky is the Limit” should generate output
“HSeklyliosWtohrelLdimit”
Total 56
Note
i. More Practical Exercises can be designed and offered by the respective course teacher to
develop the industry relevant skills/outcomes to match the COs. The above table is only a
suggestive list.
GTU - COGC-2021 Curriculum
Page 8 of 16
Scripting Language - Python Course Code: 4330701
ii. The following are some sample ‘Process’ and ‘Product’ related skills (more may be
added/deleted depending on the course) that occur in the above listed Practical Exercises
of this course required, which are embedded in the COs and ultimately the competency.
S.
Sample Performance Indicators for the PrOs Weightage in %
No.
3 Code efficiency. 20
4 Debugging ability. 20
Total 100
Text Editor (VS Code, Sublime Text, Atom, Vim or any other editor) or
2 All
Python IDE (IDLE, PyCharm, PyDev, Spyder or any other IDE)
The ADOs are best developed through the laboratory/field based exercises. Moreover, the level
of achievement of the ADOs according to Krathwohl’s ‘Affective Domain Taxonomy’ should
gradually increase as planned below:
i. ‘Valuing Level’ in 1st year
ii. ‘Organization Level’ in 2nd year.
iii. ‘Characterization Level’ in 3rd year.
8. UNDERPINNING THEORY
The major underpinning Theory is formulated as given below and only higher level UOs of
Revised Bloom’s taxonomy are mentioned for the development of the COs and competency
in the students by the teachers. (Higher level UOs automatically include lower level UOs in
them). If required, more such higher level UOs could be included by the course teacher to
focus on attainment of COs and competency.
Unit-3: 3.a Develop program using 3.1 Lists and operations on Lists
Structured types – Tuples, 3.2 Tuples and operations on Tuples
Lists, Tuples, Lists, Sets and Dictionaries 3.3 Sets and operations on Sets
Sets and 3.4 Dictionaries and operations on
Dictionaries Dictionaries
I Fundamentals of Python 7 2 4 4 10
Total 42 16 20 34 70
Legends: R=Remember, U=Understand, A=Apply and above (Revised Bloom’s taxonomy)
Note: This specification table provides general guidelines to assist student for their learning
and to teachers to teach and question paper designers/setters to formulate test
items/questions assess the attainment of the UOs. The actual distribution of marks at different
taxonomy levels (of R, U and A) in the question paper may vary slightly from above table.
f) Article Reader: Develop a Python project that automatically reads the article from the
provided link.
g) Audio Book: Develop a Python project that can be used to convert a pdf into an
audiobook.
h) URL shortener: Develop a Python script that shortens a given URL.
i) Tic-Tac-Toe: Develop a Python project for tic-tac-toe game.
j) Desktop Notifier in Python: Develop a Python project to generate pop-up notification
messages on desktop.
k) Morse Code Encryption/Decryption program: Develop a Python project that should be
able to both convert an English message file into Morse code, and a Morse code fi le
into English.
Competency Develop simple applications using Python to solve the given problem.
CO a) Develop programs to
solve the given simple
computational 3 2 1 2 - - 1
problems.
CO c) Implement data
structures lists, tuples,
sets and dictionaries to
2 1 2 2 - 2 2
solve the given
problems.
CO d)Apply modular
programming
approach to solve the
2 2 3 2 - 3 3
given problems using
user-defined functions.
CO e) Perform string
manipulation and file 2
2 2 3 2 - 2
operations to solve
the given problems.
Legend: ‘3’ for high, ‘2’ for medium, ‘1’ for low or ‘-’ for the relevant correlation of each competency, CO, with PO/ PSO
S.
No.
Name and Designation Institute Contact No. Email
Government
Smt. Jasmine Kargathala,
Girls
3 Lecturer in Computer 9824799620 [email protected]
Polytechnic -
Engineering
Ahmedabad