Scripting Languages Course Overview
Scripting Languages Course Overview
POLYTECHNIC
(COURSE FILE)
Scripting Languages
(Subject Code : CST203)
1. Cover page 1
6. Course Outcomes 9
7. Brief notes on the importance of the course and how it connects to 9-10
Bloom’s Taxonomy
8. Prerequisites, if any 10
[2]
14. Additional topics (experiments etc.), lab record (if any)
15. Internal & ESE (WBSCT & VE & SD) Question Papers 18-26
16. Question bank (Objective & Essay type unit wise) 27-31
[3]
Syllabus copy prescribed by West Bengal State Council of Technical
& Vocational Education and Skill Development:
[4]
[5]
[6]
RAGHUNATHPUR GOVERNMENT POLYTECHNIC
SARBARI MORE, NETURIA, PURULIA, GOVT. OF. WEST BENGAL
Institute Mission:
1. To promote excellence in learning, teaching, and technology transfer
2. To improve the quality of skilled workforce through a structured program and
professional skills training
3. To inspire students to learn and facilitate their overall development with social
orientation and values
4. To provide holistic learning ambience
5. To impart skills leading to employability and entrepreneurship
6. To offer services for the development of society through Education and Technology
Institute Vision:
To be a premier Institute in pursuit of excellence in technical education and skill development
committed to serve the society by offering quality education to train future leaders in
technology and by applying technology breakthroughs for India’s wealth creation and social
welfare.
Departmental Mission:
1. Provide excellent education by teaching students in a detailed and practical way using
the latest tools and technologies.
2. Motivate students to be lifelong learners in a connected world and instill in them
professional skills and ethical responsibilities.
3. Produce students who are successful and responsible in their personal and professional
lives, and who are committed to continuous learning throughout their lives.
4. Foster a supportive environment that encourages students to excel academically and
grow personally.
5. Cultivate a sense of responsibility and dedication to learning that extends beyond
academics.
[7]
Departmental Vision:
To help students become creative, motivated, skilled in technology, and responsible individuals
with good values. They will make valuable contributions and achieve high standards of
education everywhere they go. This will be accomplished by creating a supportive and effective
learning environment that can quickly adapt to the challenges of our constantly changing
world.
[8]
Program Specific Outcomes (PSOs):
After the successful completion of diploma programme in Computer Science and Technology,
the students will be able to:
▪ PSO 1: Use the latest technologies in Computer Science and system design to create
smart products that solve real-world problems.
▪ PSO 2: Design, develop, and put into action smart systems and technologies that meet
the needs of society and industry.
▪ PSO 3: Analyse and identify faults and issues in computer and embedded devices and
systems to effectively manage their performance.
This course is to be prepared to serve as an introductory course for Scripting Languages using
Python. It aims to give a comprehensive up-to-date presentation of the role of Scripting
Languages (SL) in writing codes, how it is different from Programming Languages, and the
applications of SL in modern system designs. It begins with the primary idea of Scripting.
Then it gives basic idea on variables, datatypes, control structures etc. In continuation, it
provides a theoretical summary along with different important aspects of Python, such as,
functions, modules, and packages. Then it goes to show how SL using Python is used
successfully in different components of application development, such as, File I/O, Text
Processing, Regular Expressions.
Overall, the Scripting Languages course is an essential part of the Diploma in Computer
Science and Technology program. It provides students with the knowledge and skills they need
to design, implement, and execute safe, reliable, and efficient system and user applications.
[9]
Connection of Course Outcomes with Bloom’s Taxonomy:
After completion of the course,
Sl. No. Blooms Taxonomy Level
the students will beable to:
Students will be able to build
Remember (Level 1),
program with a Scripting
CST203.1 Understand(Level 2),
Language
Apply(Level 3)
Students will be able to learn any
Understand(Level 2), Apply(Level
CST203.2 other scripting language on their
3), Analyse (4)
own.
Design real life situational Remember (Level 1),
CST203.3 problems and think creatively Understand(Level 2), Apply(Level
about solutions of them. 3), Analyse (4)
Apply a solution clearly and
Understand(Level 2),
CST203.4 accurately in a program using
Apply(Level 3)
Python.
Remember(Level 1),
Apply the best features of Python
CST203.5 Understand(Level 2),
to program real life problems.
Apply(Level 3)
Course Prerequisites:
NIL.
CO-PO-PSO Mapping:
Scripting Languages
Program Outcomes (POs) Program Specific
Outcomes (PSOs)
PO PO PO PO PO PO PO PSO PSO PSO 3
1 2 3 4 5 6 7 1 2
CST203.1 3 3 3 2 1 1 1 2 3 2
CST203.2 3 3 2 2 1 2 2 3 3 2
CST203.3 2 3 3 2 3 2 1 3 3 3
CST203.4 2 2 3 2 1 2 1 3 3 3
CST203.5 2 2 3 2 2 2 1 3 3 3
Avg 2.4 2.6 2.8 2 1.6 1.8 1.2 2.8 3 2.6
[10]
Class Time Table:
10:30 AM- 11:30AM- 12:30 PM- 1:30 PM- 1:50 PM- 2:50 PM- 3:50 PM-
DAY
11:30 AM 12:30 PM 1:30 PM 1:50 PM 2:50 PM 3:50 PM 4:50 PM
Scripting
Language
MONDAY (A101)
BREAK
SATURDAY
[11]
Lecture schedule with methodology being used/adopted:
Department of Computer Science and Engineering
Nature of Course : Theory Target Students : 30, CST 2nd yr., 3rd Sem.
Date of
Sl. No.
Topics
Date
Unit
No.
[12]
operations: Apply(Lev work in related to String
String literals, el 3) Smart datatype
manipulating Classroom 2. Explain the
strings, principles and
comparing concepts behind
strings, Unicode Strings
string literals,
converting
between Simple
Types,
Converting to
strings,
String
Formatting,
String Methods.
[13]
el 3), Smart 2. Analyse how
Analyse (4) Classroom conditional blocks
work and apply them
into programming
[14]
15. 3. 15. Passing Understand CO3 Lecture, 1. Understand and
arguments from (Level 2), Board- apply passing
a tuple Apply(Lev work, and arguments from a
el 3) computer tuple
programmi
ng
demonstrati
on in Smart
Classroom
20. 4. 20. File modes and Understand CO4 Lecture, 1. Understand file
permissions (Level 2), Board- modes and
read functions: Apply work, and permissions in
read(), (Level 3) computer python
readline(), programmi 2. Apply that to write
readlines() ng various programs.
write functions demonstrati
:write(),writelin on in Smart
es() Classroom
[15]
21. 4. 21. other file Understand CO4 Lecture, 1. Understand
operations: (Level 2), Board- various file
open(),close(),te Apply work, and operations in python
ll(),seek(),flush( (Level 3) computer 2. Apply that to write
),fileno(), programmi various programs.
isatty(),next() ng
Redirecting demonstrati
output streams on in Smart
to files. Classroom
[16]
27. 5. 27. Display object Apply(Lev CO4 Lecture, 1. Apply the
lists in a el 3) Board- knowledge to write
template work, and Django pages.
• Handle chains computer
with filters in programmi
Django ng
• Use URLs demonstrati
effectively on in Smart
Classroom
__________________________________
Signature of the Faculty
Teaching Notes:
Google Drive link for teaching notes: [Link]
lAZ8sJEVqk70hzBotVO0nYTi?usp=drive_link
[17]
External Theoretical Examination Question Papers:
[18]
[19]
[20]
[21]
[22]
Internal Examination Question Papers:
Ma
Uni Type of the
ppin
Choose the correct output of following code t/M question as
A. g
blocks (1 x 5 = 5) odu per Bloom’s
with
le Taxonomy
COs
1. print (bool()) 1 CO Apply
a) FALSE b) False c) false 1
d) ERROR
2. print ('print'.split('i')[1]) 1 CO Apply
a) print b) pr c) nt d) 1
ERROR
[23]
3. print ([1,2,3] + 'list') 1 CO Apply
a) [1, 2, 3, ‘list’] b) [‘list’, 1, 2, 3] 1
c) [1, 2, 3] + [‘list’] d)
ERROR
Cognitive level distribution for Mid semester class test (1 st Internal Examination)
Cognitive Level Questions(%) Marks(F.M=20)
Analyse 50 10
Apply 25 5
Understand 15 3
Remember 10 2
[24]
Raghunathpur Govt. Polytechnic
2nd Internal
CST- 2nd Year- 3rd Semester
Time: 45 Min Subject- Scripting Languages (Python) Full Marks: 20
Ma
Uni Type of the
ppin
t/M question as
A. Choose the correct output (1 x 5 = 5) g
odu per Bloom’s
with
le Taxonomy
COs
1. In python file handling, r+ mode opens files for 3 CO Analyse
a) reading only b) reading and writing c) 3
reading, writing, and appending d) no such
mode
[25]
3. The function that substitutes patterns in a string 3 CO Understand
with other patterns is __________. 3
Cognitive level distribution for Mid semester class test (2nd Internal Examination)
Cognitive Level Questions(%) Marks(F.M=20)
Analyse 40 8
Understand 25 5
Apply 25 5
Remember 10 2
[26]
Question bank For Scripting Languages (Python)
MCQ Questions
1. Who developed Python Programming Language?
a) Wick van Rossum
b) Rasmus Lerdorf
d) Niene Stom
b) structured programming
c) functional programming
c) machine dependent
c) .py
d) .p
[27]
6. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
c) 4
d) 1
c) Brackets
b) Def
c) Fun
d) Define
10. Which of the following character is used to give single-line comments in Python? a)
//
b) #
c) !
d) /*
[28]
11. What will be the output of the following Python code?
i = 1 while True: if
i%3 == 0:
break print(i)
i + = 1 a) 1 2 3
b) error
c) 1 2
12. Which of the following functions can help us to find the version of python that we
are currently working on? a) [Link](1)
b) [Link](0)
c) [Link]()
d) [Link]
13. Python supports the creation of anonymous functions at runtime, using a construct called
__________
a) pi
b) anonymous
c) lambda
[29]
15. What will be the output of the following Python code snippet if x=1?
x<<2
a) 4
b) 2
c) 1
d) 8
[30]
8. Name the Python Library modules which need to be imported to invoke the following
function: dump()
9. Name the function / method required for finding second occurrence of m in madam.
10. Name the function / method required for getting the position of an item in the list.
11. Which string method is used to count the number of characters in the string?
12. Which string method is used to change the first character of the string in capital letter?
13. Which string method is used to check whether given character is letter or a number?
14. Which string method is used to change lowercase to uppercase letter?
15. Which string method is used to change one character into another character?
[31]
Assignments Questions:
return inner_fun(a, b)
return a
2. Choose the correct function declaration of fun1() so that we can execute the following function
call successfully
def fun1(num):
return num + 25
fun1(5)
result = add(3, 2)
print(result)
def display_person(*args):
for i in args:
print(i)
display_person(name="Emma", age="25")
[32]
6. What is the output of the following display() function call
def display(**kwargs):
for i in kwargs:
print(i)
display(emp="Kelly", salary=9000)
fun1('Emma', 25)
myString = "pynative"
stringList = ["abc", "pynative", "xyz"]
print(stringList[1] == myString)
print(stringList[1] is myString)
[33]
13. What is the output of the following string operations
str1 = "PYnative"
print(str1[1:4], str1[:5], str1[4:], str1[0:-1], str1[:-1])
str1 = 'Welcome'
print (str1[:6] + ' PYnative')
print([Link]())
print([Link]())
str1 = 'Welcome'
print(str1*2)
strOne = str("pynative")
strTwo = "pynative"
print(strOne == strTwo)
print(strOne is strTwo)
[Link](2)
print(sampleList)
[34]
20. What is the output of the following code
aList = [1, 2, 3, 4, 5, 6, 7]
pow2 = [2 * x for x in aList]
print(pow2)
l = [None] * 10
print(len(l))
resList = [x+y for x in ['Hello ', 'Good '] for y in ['Dear', 'Bye']]
print(resList)
[35]
28. What is the output of the following list function?
[Link](60)
print(sampleList)
Video Links
[Link]
[Link]
[Link]
[Link]
[Link]
1. Email *
2. Full Name *
3. Registration Number *
[37]
Strongly Agree
Agree
Neutral
Disagree
Strongly Disagree
Strongly Agree
Agree
Neutral
Disagree
Strongly Disagree
Strongly Agree
Agree
Neutral
Disagree
Strongly disagree
[38]
7. Course Outcome 4 : Students will be able to apply a solution clearly and *
accurately in a program using Python.
Strongly agree
Agree
Neutral
Disagree
Strongly Disagree
8. Course Outcome 5 : Students will be able to apply the best features of * Python
to program real life problems.
Strongly agree
Agree
Neutral
Disagree
Strongly Disagree
[39]
CO-PO-PSO Attainment:
Target Attainment level on a 3-point Scale: 2.5
31 31 31 31 31
Total No of students appeared in exam:
Total No of students who got more than 50% 13 23 18 5 31
marks in exam:
42% 74% 58% 16% 100%
% of students who got more than 50% marks
CO Attainment level 1 3 2 0 3
[40]
Direct Attainment Calculation for External End Semester
Examination:
CO Attainment Criteria:
Attainment CO1,CO2.CO3,CO
60% Of students greater than or equal to 50% marks:Level 3 Calculation 4,CO5
Total No of
students appeared 31
50% Of students greater than or equal to 50% marks:Level 2 in exam:
Total No of
students who got
19
more than 50%
40% Of students greater than or equal to 50% marks:Level 1 marks in exam:
% of students who
got more than 50% 61%
marks
CO Attainment 3
level
[41]
Indirect Attainment Calculation for Course End Survey:
28 28 28 28 28
Total No of students given feedback
Total No of students given feedback of agree(4) or 23 26 22 22 20
above
% of students who given feedback of agree(4) or 82% 93% 79% 79% 71%
above
CO Attainment level 3 3 3 3 3
[42]
Overall CO Attainment:
FINAL CO ATTAINMENT
Final CO
Attainment
Levels
Weight Assessment type CO1 CO2 CO3 CO4 CO5
80% Direct 2.2 3 2.6 1.8 3
20% Indirect 3 3 3 3 3
[43]
CO PO PSO MAPPING & ATTAINMENT
CO Attainment PO1 PO2 PO3 PO4 PO5 PO6 PO7 PSO1 PSO2 PSO3 Level Value
CO1 2.36 3 3 3 2 1 1 1 2 3 2 HIGH 3
CO2 3.00 3 3 2 2 1 2 2 3 3 2 MEDIUM 2
CO3 2.68 2 3 3 2 3 2 1 3 3 3 LOW 1
CO4 2.04 2 2 3 2 1 2 1 3 3 3 N.R. 0
CO5 3.00 2 2 3 2 2 2 1 3 3 3
PO Attainment 2.63 2.63 2.59 2.62 2.68 2.64 2.68 2.63 2.62 2.31
Overall Attainment 2.64
Scripting Languages
Program Specific
Program Outcomes(POs)
Outcomes(PSOs)
PO 1 PO 2 PO 3 PO 4 PO 5 PO 6 PO 7 PSO 1 PSO 2 PSO 3
CO 1 3 3 3 2 1 1 1 2 3 2
CO 2 3 3 2 2 1 2 2 3 3 2
CO 3 2 3 3 2 3 2 1 3 3 3
CO 4 2 2 3 2 1 2 1 3 3 3
CO 5 2 2 3 2 2 2 1 3 3 3
Avg 2.4 2.6 2.8 2 1.6 1.8 1.2 2.8 3 2.6
Attainment Gap
No Attainment Gap.
Student List:
Sl. Registration.
Student Name
No. No.
Mapping
Program Outcomes (PO) Course Outcomes (CO) Explanation
Score
The course outcome directly aligns with the
CO 1. Students will be
program outcome, as it requires applying basic
able to build program
3 domain specific engineering fundamentals to
with a Scripting
identify and calculate different types of problem
Language
solving using a scripting language.
[45]
Mapping
Program Outcomes (PO) Course Outcomes (CO) Explanation
Score
The course outcome CO 2 aligns perfectly with the
CO 2. Students will be
program outcome PO 2, as understanding the
able to learn any other
3 structure and working of scripting is crucial for
scripting language on
identifying and analysing well-defined engineering
their own
problems related to power systems.
PO 3. Design/development CO 3. Design real life The course outcome aligns with the program
situational problems and outcome by requiring the design and analysis of
of solutions 3
think creatively about the working of various file systems to apply them
solutions of them in different applications.
[46]
Mapping
Program Outcomes (PO) Course Outcomes (CO) Explanation
Score
Engineering tools and techniques such as file
CO 1. Students will be
handling and regular expressions are used to
able to build program 2
identify and solve problems in the software
with a Scripting systems.
Language
[47]
Mapping
Program Outcomes (PO) Course Outcomes (CO) Explanation
Score
Scripting languages such as python is an essential
CO 5. Apply the best
component of software systems that ensure system
features of Python to 2
reliability and stability, which are important for
program real life society and sustainability.
problems
[48]
Mapping
Program Outcomes (PO) Course Outcomes (CO) Explanation
Score
CO 3. Design real life The ability to analyse individual needs and engage
situational problems and in updating in the context of technological changes
1
think creatively about can be applied to the field of scripting systems to
solutions of them continuously improve one's skills and knowledge.
CO 5. Apply the best The ability to analyse individual needs and engage
features of Python to in updating in the context of technological changes
1
program real life can be applied to the field of software systems to
problems continuously improve one's skills and knowledge.
CO 1. Students will be
The ability to identify various types of errors in
able to build program
2 software systems is essential for system design and
with a Scripting
real-world product development
Language
CO 2. Students will be
Understanding the construction and working of
able to learn any other
3 various types of scripts is crucial for real world
scripting language on
product design
their own
PSO 1: Use the latest
technologies in Computer CO 3. Design real life Understanding the construction and working of file
Science and system design situational problems and handling and regular expressions is important in
to create smart products 3
think creatively about providing solutions to real-world problems through
that solve real-world solutions of them smart product development.
problems.
[49]
Mapping
Program Outcomes (PO) Course Outcomes (CO) Explanation
Score
CO 1. Students will be
able to build program
3
with a Scripting
Language
CO 2. Students will be
able to learn any other
3
scripting language on
their own
[50]
Mapping
Program Outcomes (PO) Course Outcomes (CO) Explanation
Score
CO 4. Apply a solution
clearly and accurately in 3 Knowledge of scripting systems is directly related
a program using Python to the ability to diagnose faults in those systems.
[51]
[52]
Regular expressions in Python are used for powerful pattern matching and searching tasks, including data validation, text parsing, and string manipulation. Functions like re.match(), re.search(), and re.findall() allow users to efficiently search for patterns within text, which is particularly useful in applications like form validation, data scraping, and automated testing .
Django's MVC (Model-View-Controller) framework facilitates efficient web development by promoting a clean separation of the code into three components: models handle the database, views format and manage the output data presentation, and templates manage user interface. This separation enhances maintainability, scalability, and makes collaborative development more streamlined .
Scope and binding determine where a variable can be accessed within the program. In Python, local variables are accessible only within the function they're defined in, while global variables can be accessed across the program. Nonlocal variables allow access to variables in an enclosing scope, typically within nested functions. Understanding scope is crucial for managing variable lifecycle and avoiding unexpected bugs or behavior in larger programs .
Arbitrary, optional, and named arguments in Python functions enhance flexibility by allowing functions to dynamically handle varying numbers of input parameters. Arbitrary arguments (*args) accommodate multiple inputs, optional arguments provide default values to parameters, and named arguments enhance readability by allowing function calls to specify parameters explicitly by name, increasing the clarity and reusability of functions .
Logical operators (such as 'and', 'or', 'not') evaluate entire expressions and return boolean values whereas bitwise operators ('&', '|', '^') perform operations at the bit level and work primarily on binary numbers. Logical operators are typically used in control structures and conditions, while bitwise operators are used for low-level binary manipulation .
Learning scripting languages like Python offers substantial educational and professional advantages, as Python's readability and simplicity make it an ideal language for teaching programming fundamentals and logic. Its extensive libraries and frameworks support various fields such as data science, web development, and automation, enhancing a learner’s capability to solve complex real-world problems and making them more versatile in the job market .
Coding blocks in Python, such as conditional blocks (if, elif, else) and loops (for, while), help segment code into logical parts. These blocks enhance readability by structurally simplifying the logic of a program. Using consistent indentation makes the code organized, and separating different logical functions into blocks can improve both readability and debugging ease .
Python has various types of operators including logical, bitwise, membership, and identity operators. Operator precedence determines the order in which operations are evaluated. For example, multiplication has a higher precedence than addition, which means expressions are evaluated in that order unless parentheses are used to explicitly define evaluation order .
Modules allow you to logically organize your Python code by grouping related functions, classes, or variables together, which can then be imported and used in other modules or scripts. Packages provide a way to group related modules together. This modular approach not only keeps code organized and manageable but also promotes code reuse across projects and simplifies collaboration among developers .
Python file operations allow for reading from and writing to files, which are critical for data persistence and processing in applications. The benefits include robust functions for file manipulation, easy data extraction, and storage. However, challenges can arise in handling file permissions, ensuring data integrity, and managing resource closure to avoid memory leaks .