Skip to content

Assignment Fresher

Assigments

Q1. Write a Program To REVERSE content of the given String by using while loop


Q2. Sort characters of the string, first alphabet symbols followed by digits


Q3. Program for the requirement,input a3z2b4 and expected output aaabbbbzz


Q4. Program to remove duplicate characters from the given input String


Q5. Find no of occurrences of each character present in given string with count( )


Q6. Program to check whether the given string is palindrome or not?"


Q7. No of occurrences of each character present in given string without count()


Q8. Program to check whether the given two strings are anagrams or not?


Q9. Program to find the number of occurrences of each vowel present in given string


Q10. You’re a restaurant owner and want to calculate the final bill including a service charge and tax. Write a program that asks for the base bill amount and applies a 5% service charge and 10% tax


Q11. You are tasked with building a password generator for a banking app. The bank has strict password rules: passwords must be 12 characters long, contain at least one uppercase letter, one lowercase letter, one number, and one special character (!, @, #, etc.). Write a Python program that generates such strong passwords


Q12. You are tasked with creating a password generator for a gaming company that creates themed passwords for users. The passwords should include a theme (e.g., "dragon", "warrior") and some random characters. Write a Python program that generates such themed passwords


Q13. You are developing a password generator for a company with a strict policy that passwords cannot contain consecutive repeated characters (e.g., "aa" or "11"). Write a Python program that generates secure passwords that follow this rule


Q14. You're creating a BMI calculator. Write a program that asks for a user’s height and weight, calculates their BMI, and categorizes them as underweight, normal, or overweight


Q15. You’re designing a grading system for a school. Write a Python program to check whether a student has passed or failed based on input marks


Q16. You’re working as a developer at a retail company. Write a program to take a price input from the user and apply a discount of 10% if the price is above $100


Q17. You’re writing a text editor. Write a program that reads a paragraph and counts how many times each word appears


Q18. You're building a meal planner. Write a Python program that stores different meal options for the week in a list and allows the user to print the meals for any specific day


Q19. You’re developing a library system. Write a Python program to keep track of borrowed books using a tuple, where each tuple holds the book name and due date


Q20. You are working on a task tracker. Write a program that takes a list of tasks, lets the user mark tasks as complete, and then displays only the remaining tasks


Q21. You are building a registration system for an online course. Write a Python program that checks if a student’s name is already registered (find duplicates)


Q22. You are working for an airline and need to manage flight bookings. Write a Python program that takes a list of booked passengers and prints the names in alphabetical order


Q23. You're a game developer creating a turn-based game. Write a program that simulates rolling a die and repeats the process until one player reaches a score of 100


Q24. You're building a weather station simulation. Write a Python program that prompts for temperature readings and gives recommendations based on ranges (e.g., if below 10°C, print “Wear a jacket”)


Q25. Imagine you’re simulating a simple banking system. Write a program that asks for a withdrawal amount and checks if the user has enough balance, printing appropriate messages


Q26. You're creating a password strength checker. Write a Python program to determine if a user’s password meets requirements (length and character types)


Q27. You are developing a traffic control system. Write a Python program that changes the signal color based on time intervals (red, green, yellow)


Q28. You're creating a simple playlist system. Write a Python program that accepts song titles from the user and removes duplicates


Q29. A customer deposits and withdraws money from their bank account. Write a program that updates the account balance after each transaction


Q30. A school is managing student attendance. Write a program that calculates the attendance percentage for each student based on the total number of days attended


Q31. The school is holding an event, and only students with more than 90% attendance are invited. Write a program that generates this invite list


Q32. You’re building a digital library app. Users upload book titles to the system. Write a program that checks for duplicate titles and removes them before storing the final list


Q33. The library keeps track of book borrowings. Given a list of borrowed books, write a program to identify and display the most borrowed book


Q34. A user wants to search for a book using only part of the title. Write a function that returns all books that contain the search term


Q35. You’re categorizing books based on their genre. Write a program that reads a file of book titles and genres, and then creates a dictionary with genres as keys and book titles as values


Q36. Each book has an author’s name. Write a program that takes a list of books and authors, and then checks if any author has written more than one book


Q37. Your movie rental system stores a list of rented movies with the user who rented them. Write a program that calculates the number of movies each user has rented


Q38. Create a function that checks whether a movie is available for rental, given a list of rented movies and total inventory


Q39. Your rental system offers discounts to frequent users. Write a program that identifies users who rented more than 10 movies in a month and gives them a discount. (Hard)


Q40. Guests can cancel their bookings. Write a function that removes a guest’s booking from the system and updates room availability


Q41. Write a program that randomly assigns students to project topics using a list, ensuring no student is assigned the same topic


Q42. You are tasked with creating a voting system for a competition. Write a Python program that stores contestant names and their vote counts in a dictionary and displays the contestant with the most votes


Q43. You’re building a music library app. Write a program that stores song titles and artists in a dictionary and allows users to search for songs by artist name


Q44. Write a program that takes a dictionary of student names and their test scores, and calculates the class average and top score


Q45. You are a manager at a café and need to track how many cups of coffee each customer buys. Write a Python program to store customer names and coffee quantities in a dictionary, then find the top buyer


Q46. You’re building a movie recommendation system. Write a Python program that compares movie genres watched by two users and recommends a movie from the genres they haven’t seen yet


Q47. You are tasked with creating a name validation system. Write a Python program that checks if any letters in a name are repeated using sets


Q48. You’re developing a music streaming service. Write a Python program that finds common songs between two users’ playlists using sets


Q49. You’re managing a university course registration system. Write a program that stores registered students in a set and checks if a student is already enrolled


Q50. You are working for a hospital. Write a Python program that keeps track of patient records in a list of tuples (name, age, diagnosis) and lets the user update the diagnosis


Q51. You’re building a car rental system. Write a Python program that stores available cars in a list and allows users to rent a car by removing it from the list


Q52. You’re tasked with creating a contact book. Write a Python program that stores contacts in a list of tuples (name, phone number) and lets the user add, delete, and search contacts


Q53. You’re helping organize a conference. Write a program that stores attendees' names in a tuple and allows the user to search for a name


Q54. You are building a system for a coffee shop. Write a function that takes a list of orders and returns the total cost


Q55. You’re tasked with creating a personalized greeting app. Write a function that takes a name and returns a greeting with the current time of day


Q56. You are developing a game. Write a function that rolls two dice and returns the sum of the values


Q57. You are responsible for managing a gym’s membership system. Write a Python program that stores member names and their expiration dates in a dictionary, and checks which memberships are expiring this month


Q58. You're a teacher who needs to calculate the final grade for students. Write a Python program that stores student names and their grades in a dictionary, and allows the user to calculate the class average


Q59. You're working with a translation service. Write a Python program that takes a sentence and translates it into Pig Latin (move the first letter of each word to the end and add “ay”)


Q60. You are tasked with formatting product descriptions for a catalog. Write a Python program that capitalizes the first and last letter of each word


Q61. You’re creating a registration system. Write a Python program that checks if an email address contains “@” and ends with “.com”


Q62. You’re building a customer feedback system. Write a Python program to find the most frequently occurring word in a customer feedback string


Q63. You're helping with SEO for a website. Write a Python program that counts how many times specific keywords appear in a webpage text


Q64. You are developing a secure messaging app. Write a Python program that takes a message from the user and reverses each word in the sentence


Q65. You are tasked with cleaning up user data. Write a Python program that removes all special characters from a string


FOR CR OR Toppers

Q66. Perform the following part of the assignment

Prompt :

  • Press 1 to Add employee
  • Press 2 to exit

Read Employee Data from the Keyboard and print data

Employee No : 100 Employee Name : Sunny Employee Salary : 1000.0 Employee Address : Mumbai Employee Married ? : True (boolean value)

  1. Prompt to add another user enter yes, y to exit enter no, n
  2. Display all Employee information
  3. Store the result in file.

Q66. Perform the following steps on the attached file

  • The file contains English words corresponding to its Punjabi words.
  • Perform search operation in such a way that it returns English words by taking Punjabi words as an input.

Q67. Assignment: Number to Word Converter

  • Your task is to write a program that takes an integer as input from the user and displays the corresponding word for that number. For example, if the user enters "1", the program should display "one". The program should be able to handle numbers between 0 and 999.
  • Here are the rules for the conversion:
  • Numbers 0 to 20 should be converted to their corresponding word (e.g.. 0 should be "zero", 1 should be "one", and so on).
  • Numbers from 21 to 99 should be converted to words by combining the words for the tens place and the ones place. For example, 23 should be "twenty-three", and 99 should be "ninety-nine".
  • Numbers from 100 to 999 should be converted to words by combining the words for the hundreds place, the tens place, and the ones place. For example, 325 should be "three hundred twenty-five".
  • Your program should display an error message if the user enters a number outside of the range of 0 to 99999.

Q68. Bank Account Creation with Random Account Numbers and Initial Balance

  • You are hired by a new bank to develop a system for automatically generating account numbers when a customer creates a new bank account. The system needs to:
  • Generate a random, unique account number for each customer. The account number should be a 10-digit number.
  • Allow the customer to set an initial deposit for the account, which must be greater than or equal to zero.
  • If the customer tries to deposit a negative amount, the account creation should be denied.
  • Each account should have a customer name attached to it.
  • After creating the account, display the account number, customer name, and initial balance.
  • The account should be stored in a dictionary, with the account number as the key and the account details (name and balance) as the value.

Q69. Username Generator for Email System

  • A company wants to automate the creation of email usernames for new employees. The email address should be generated based on the employee's full name. Write a Python program that:
  • Takes the employee's full name (first and last name) as input.
  • Converts the name into a lowercase username with the format first initial + last name (e.g., John Doe → jdoe).
  • If the last name contains any spaces or special characters, they should be removed from the username.
  • Ensure that the final username contains only lowercase letters and no spaces.
  • If the username already exists, append a number to it (e.g., jdoe1, jdoe2).
  • Hint: You will need to use string manipulation functions to handle formatting and ensure uniqueness.

Q69. Palindrome Substring Finder

  • You are working on a project to detect palindrome substrings in a given string. Write a Python program that:
  • Takes a sentence as input.
  • Identifies and returns all unique palindromic substrings (strings that read the same forward and backward) of at least 3 characters.
  • Your program should ignore punctuation and spaces while checking for palindromes, but should return the palindromic substrings with their original punctuation intact.
  • Example:
  • Input: "A man, a plan, a canal: Panama"
  • Output: ["ama", "ana", "A man a plan a canal Panama"]
  • Hint: Use string slicing and helper functions to clean the input, check for palindromes, and extract substrings.

Q70. Encrypted Message Decryption

  • You have intercepted a secret message that has been encrypted by reversing the words and shifting the characters in the alphabet by a certain number. Write a Python program that:
  • Takes a reversed encrypted message and the shift value as input.
  • Reverses the entire message so the words are in the correct order.
  • Shifts the characters back by the given shift value to reveal the original message (e.g., a shift of 2 means 'c' becomes 'a', 'b' becomes 'z', etc.).
  • Ensure that only alphabetic characters are shifted (leave spaces and punctuation unchanged).
  • Example:
  • Encrypted Input: "khoor zruog" (with a shift of 3)
  • Decrypted Output: "hello world"
  • Hint: You will need to use string methods and implement a custom Caesar cipher for character shifting.

Q71. Longest Word Without Repeated Characters

  • You are developing a word puzzle game. One of the challenges is to find the longest word in a sentence where no letter repeats. Write a Python program that:
  • Takes a sentence as input.
  • Splits the sentence into individual words.
  • Finds and returns the longest word where no letter appears more than once.
  • If there are multiple words of the same length, return the one that appears first in the sentence.
  • Example:
  • Input: "I am programming with Python"
  • Output: "with"
  • Hint: You'll need to check each word for uniqueness using string operations and sets.

Q72. Anagram Grouping System

  • You are working for a word game company, and they want a system to group words that are anagrams of each other. Write a Python program that:
  • Takes a list of words as input (e.g., ["listen", "silent", "enlist", "google", "gogole", "god"]).
  • Groups all words that are anagrams of each other (words that can be rearranged to form the same string) into lists.
  • Outputs a list of lists, where each sublist contains the anagram group.
  • Example:
  • Input: ["listen", "silent", "enlist", "google", "gogole", "god", "dog"]
  • Output: [["listen", "silent", "enlist"], ["google", "gogole"], ["god", "dog"]]
  • Hint: You can use sorting or dictionaries with string operations to identify anagram groups.