Subject Name: Scripting Language Subject Code: DI02000101
VPMP Polytechnic
Department of Computer Engineering
Scripting Language (DI02000101)
Assignments
«Assignment: 1»
1. What is Type Casting? Explain implicit type conversion and explicit type
conversion with example.
2. List out features and application of python.
3. Explain input and print functions in python with examples.
4. Explain Basic Structure of Python program.
5. Design and Test Python program to read your name, contact number, email, and
birth-date and print those details on the screen.
«Assignment: 2»
1. What is Operators? List out all different types of operators. Explain Special
Operator and Membership Operator with example.
2. Explain if and if-else statement with a suitable example.
3. Describe for loop with an example.
4. Explain break, continue and pass statement with suitable example.
5. Make a use of any loop to create following pattern in python.
$
$$
$$$
$$$$
$$$$$
«Assignment: 3»
1. Explain how to create a Set in Python by giving example.
2. Differentiate tuple and list.
3. List operations of tuple (any three) and list (any three).
4. Explains how to create dictionaries in Python. Write a Python program to check if
a key exists in a dictionary.
5. Write a program that is given a dictionary containing the average daily temperature
for each day of the week, and prints all the days on which the average temperature
was between 40 and 50 degrees.
Prepared By: Department of Computer Engineering Page 1
Subject Name: Scripting Language Subject Code: DI02000101
«Assignment: 4»
1. Write a program that counts the occurrences of each digit in a string. The program
counts how many times a digit appears in the string. For example, if the input is
"12203AB3", then the output should output 0 (1 time), 1 (1 time), 2 (2 times), 3 (2
times).
2. List any six built-in functions of Python.
3. Define Recursion and demonstrate its working in Python with a suitable example.
4. Describe any three string functions with example.
5. Explain the difference between the read () and readlines () functions in Python for
file handling with suitable examples.
«Assignment: 5»
1. What is a Python module? Explain how you can import a specific function from a
module with an example.
2. Explain the functions plot () and show () from the Matplotlib package. Illustrate
your explanation with an example of a simple line plot.
3. What is indexing in Numpy arrays? Demonstrate array slicing and indexing with an
example using a 1D Numpy array.
4. Explain the function of xlabel () and ylabel () in the Matplotlib package with a
simple example.
5. Create a user defined module with simple functions for: addition, subtraction,
multiplication, division, modulo, square, factorial. Write a program to import the
module and access functions defined in the module.
Prepared By: Department of Computer Engineering Page 2