Assignment-6

 Submit before 10pm on 08-08-2026

All 3 marks questions from university question papers - Module -2.Read blog. 

1 Compare tuples, lists, and dictionaries.
2. Explain the concept of scope and lifetime of variables in Python programming language,
with a suitable example.
3.Write a python code to search a string in the given list.
4.Explain lambda functions in Python with an example
5.Let num=[14,[26,52],2,[8,3],56]. Write the expressions for following
operations in Python:
i) Replace the value 56 with 92
ii) Print the value 8.
iii) Remove the value 52 from list
6.Write a Python script to print a dictionary where the keys are numbers between 1
and 15 (both included) and the values are square of keys.
7.Explain the scope and lifetime of variables in Python programming language
with a suitable example each.
8.Compare Lists and Tuples with examples.
Illustrate the use of __name__ variable. 
9 Write a program to swap two numbers using tuple. Get the numbers from the user
prompt.
10.Apply string methods on the input “python for engineers” to:
(i) check whether a digit is present
(ii) identify whether ‘neer’ is a substring
(iii) output list of words
11 Explain the concept of mutability in the context of Python tuples. How to create
an empty tuple and a tuple containing a single integer element.
12.What are the properties of sets in Python?
13.Create an empty dictionary and add the marks the user has got in three different
subjects, reading subject names and marks from the user.

Comments

Popular posts from this blog

Python For Engineers CST 445 KTU Open Elective Notes S7 - Dr Binu V P

Model Question Paper CST 445 KTU Python For Engineers

Plotting- Simple plots,setting limits,subplot, semilog, loglog plots