Question 1 – Password Validator
Write a function checkPassword(password).
Return 'Strong Password' if the password has at least 8 characters, one uppercase letter and
one digit; otherwise return 'Weak Password'. The main program should ask the user for a
password, call the function and display the result.
Question 2 – Name Formatter
Write a function formatName(firstName, lastName) that returns the full name with the first
letter of each name capitalized.
Question 3 – Grade Calculator
Write a function calculateGrade(mark) that returns Distinction, Merit, Pass or Fail. Ask the
user for the marks of five students and display the grade for each.
Question 4 – Count Vowels
Write a function countVowels(word) that returns the number of vowels in a word without
using a built-in vowel counting function.
Question 5 – Palindrome Checker
Write a function isPalindrome(word) that returns True or False. Ask the user for a word
and display whether it is a palindrome.
Question 6 – Login System
Write a function login(username, password). Allow three attempts. Return 'Login
Successful' or 'Invalid Username or Password'.
Question 7 – Shopping Bill
Write a function calculateBill(price, quantity). Apply a 10% discount if the total exceeds
100. Ask for five products and display the grand total.
Question 8 – Word Analyzer
Write a function analyzeWord(word) that returns the number of characters, vowels and
consonants.
Question 9 – Number Statistics
Write a function statistics(numbers) that returns the largest number, smallest number and
average from a list.
Question 10 – Student Result
Write a function studentResult(name, marks) where marks is a list of five subject marks.
Return the average, highest mark, lowest mark, pass count and overall result.
Mini Project – Student Management System
Objective:
Create a menu-driven Python application that manages student records using functions.
Requirements
Store each student's name and five subject marks.
Use functions with parameters and return values.
Display a menu until the user chooses Exit.
Validate user input where appropriate.
Required Functions
addStudent()
searchStudent(name)
updateMarks(name)
calculateAverage(marks)
assignGrade(average)
displayReport(student)
showAllStudents()
Menu
1. 1. Add Student
2. 2. Search Student
3. 3. Update Marks
4. 4. Display Student Report
5. 5. Display All Students
6. 6. Exit
Extension Challenges
Count how many students passed.
Find the highest average in the class.
Display the class average.
Sort students by average.