1st Semester MCA (2022) Lab Program codes.
- --None--
- Display future leap years from current year to a final year entered by user.
- List comprehensions: (a) Generate positive list of numbers from a given list of integers. (b) Square of N numbers. (c) Form a list of vowels selected from a given word. (d) List ordinal value of each element of a word.
- Count the occurrences of each word in a line of text.
- Prompt the user for a list of integers. For all values greater than 100, store ‘over’ instead.
- Store a list of first names. Count the occurrences of ‘a’ within the list.
- Enter 2 lists of integers. Check: (a) Whether list are of same length. (b) whether list sums to same value. (c) whether any value occur in both.
- Get a string from an input string where all occurrences of first character replaced with‘$’, except first character. 09.Create a string from given string where first and last characters exchanged.
- Accept the radius from user and find area of circle.
- Find biggest of 3 numbers entered.
- Accept a file name from user and print extension of that.
- Create a list of colors from comma-separated color names entered by user. Display first and last colors.
- Accept an integer n and compute n+nn+nnn.
- Print out all colors from color-list1 not contained in color-list2.
- Create a single string separated with space from two strings by swapping the character at position 1.
- Sort dictionary in ascending and descending order.
- Merge two dictionaries.
- Find gcd of 2 numbers.
- From a list of integers, create a list removing even numbers.
- Program to find the factorial of a number.
- Generate Fibonacci series of N terms.
- Find the sum of all items in a list.
- Generate a list of four digit numbers in a given range with all their digits even and the number is a perfect square.
- Display the given pyramid with step number accepted from user.
- Count the number of characters (character frequency) in a string.
- Add ‘ing’ at the end of a given string. If it already ends with ‘ing’, then add ‘ly’.
- Accept a list of words and return length of longest word.
- Construct a pattern using nested loop.
- Generate all factors of a number.
- Write lambda functions to find area of square, rectangle and triangle.
- Work with built-in packages.
- Create a package graphics with modules rectangle, circle and sub-package 3D-graphics with modules cuboid and sphere. Include methods to find area and perimeter of respective figures in each module. Write programs that finds area and perimeter of figures by different importing statements.
- Create Rectangle class with attributes length and breadth and methods to find area and perimeter. Compare two Rectangle objects by their area.
- Create a Bank account with members account number, name, type of account and balance. Write constructor and methods to deposit at the bank and withdraw an amount from the bank.
- Create a class Rectangle with private attributes length and width. Overload ‘<’ operator to compare the area of 2 rectangles.
- Create a class Time with private attributes hour, minute and second. Overload ‘+’ operator to find sum of 2 time.
- Create a class Publisher (name). Derive class Book from Publisher with attributes title and author. Derive class Python from Book with attributes price and no_of_pages. Write a program that displays information about a Python book. Use base class constructor invocation and method overriding.
- Write a Python program to read a file line by line and store it into a list.
- Python program to copy odd lines of one file to other.
- Write a Python program to read each row from a given csv file and print a list of strings.
- Write a Python program to read specific columns of a given CSV file and print the content of the columns.
- Write a Python program to write a Python dictionary to a csv file. After writing the CSV file read the CSV file and display the content.