ABES Engineering College, Ghaziabad
Department of Computer Science
Session: 2026-27 Semester:4th Branch: ME
Course Code: BCC 402 Course Name: Python Programming
Class Test-3/ Assignment 3
Date of Assignment/Test: 13-Apr-2026 Date of submission(for Assignment only): 16-Apr-2026
[Link]. Question CO
Write a Python program to validate a password entered by the user. CO3
1 The password must satisfy the following conditions:
• It should be at least 8 characters long.
• It must contain at least one uppercase letter (A–Z).
• It must contain at least one lowercase letter (a–z).
• It must contain at least one digit (0–9).
• It must contain at least one special character from the set (@, #, $, %, &, *).
• It should not contain any spaces.
• The first character should not be a digit.
If the password satisfies all the above conditions, display "Valid Password", otherwise
display "Invalid Password" with an appropriate message.
2 Write a Python program to perform the following operations on a list of strings entered by CO3
the user:
a) Accept n elements (words) from the user and store them in a list.
b) Create a new list by reversing each element (word) individually.
c) Display the new list.
d) Convert the list into a single string using the join() function and display it.
e) Display the reverse of the complete string obtained in part (d).
Example:
Input:
Enter number of elements: 4
Enter elements:
apple
banana
car
dog
List = ['apple', 'banana', 'car', 'dog']
Output:
Reversed List = ['elppa', 'ananab', 'rac', 'god']
Joined String = "elppa ananab rac god"
Reversed String = "dog car banana apple"
Python program to find Tuples with positive elements in List of tuples CO3
Input: test_list = [(4, 5, 9), (-3, 2, 3), (-3, 5, 6), (4, -6)]
Output : [(4, 5, 9)]
3 Explanation : Extracted tuples with all positive elements.
Input : test_list = [(-4, 5, 9), (-3, 2, 3), (-3, 5, 6), (4, -6)]
Output : []
Explanation: No tuple with all positive elements.
Write a Python program to perform the following operations using a dictionary: CO3
a) Create a dictionary by taking student name as key and marks as value for n students.
4
b) Display the dictionary.
c) Add a new student record into the dictionary.
d) Update the marks of an existing student.
e) Delete a student record from the dictionary.
f) Display all students who have marks greater than or equal to 50.
Output-
• Initial Dictionary: {'Ravi': 45, 'Aman': 75, 'Neha': 60}
• After Insertion: {'Ravi': 45, 'Aman': 75, 'Neha': 60, 'Rahul': 80}
• After Update: {'Ravi': 55, 'Aman': 75, 'Neha': 60, 'Rahul': 80}
• After Deletion: {'Ravi': 55, 'Neha': 60, 'Rahul': 80}
• Students with marks >= 50:
Ravi → 55
Neha → 60
Rahul → 80
5 Write a Python program using a function to generate the Fibonacci series. CO3
a) Define a function fibonacci(n) that generates the Fibonacci series up to n terms.
b) Take input from the user for the number of terms.
c) Call the function and display the Fibonacci series