Skip to content

abhilashjohn64/Programming-Lab-Python-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Programming-Lab-Python-

Course Outcome 1 (CO1):

  1. Familiarizing Text Editor, IDE, Code Analysis Tools etc // Use any IDE like PyCharm, PyDev…
  2. Display future leap years from current year to a final year entered by user.
  3. 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 (Hint: use ord() to get ordinal values)
  4. Count the occurrences of each word in a line of text.
  5. Prompt the user for a list of integers. For all values greater than 100, store ‘over’ instead.
  6. Store a list of first names. Count the occurrences of ‘a’ within the list
  7. 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
  8. Get a string from an input string where all occurrences of first character replaced with ‘$’, except first character.[eg: onion -> oni$n]
  9. Create a string from given string where first and last characters exchanged. [eg: python -> nythop]
  10. Accept the radius from user and find area of circle.
  11. Find biggest of 3 numbers entered.
  12. Accept a file name from user and print extension of that.
  13. Create a list of colors from comma-separated color names entered by user. Display first and last colors.
  14. Accept an integer n and compute n+nn+nnn.
  15. Print out all colors from color-list1 not contained in color-list2.
  16. Create a single string separated with space from two strings by swapping the character at position 1.
  17. Sort dictionary in ascending and descending order.
  18. Merge two dictionaries.
  19. Find gcd of 2 numbers.
  20. From a list of integers, create a list removing even numbers.

Course Outcome 2 (CO2)

  1. Program to find the factorial of a number
  2. Generate Fibonacci series of N terms
  3. Find the sum of all items in a list
  4. Generate a list of four digit numbers in a given range with all their digits even and the number is a perfect square.
  5. Display the given pyramid with step number accepted from user. Eg: N=4 1 2 4 3 6 9 4 8 12 16
  6. Count the number of characters (character frequency) in a string.
  7. Add ‘ing’ at the end of a given string. If it already ends with ‘ing’, then add ‘ly’
  8. Accept a list of words and return length of longest word.
  9. Construct following pattern using nested loop





  1. Generate all factors of a number.
  2. Write lambda functions to find area of square, rectangle and triangle.

Course Outcome 3(CO3):

  1. Work with built-in packages
  2. 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. (Include selective import of modules and import * statements)

Course Outcome 4 (CO4):

  1. Create Rectangle class with attributes length and breadth and methods to find area and perimeter. Compare two Rectangle objects by their area.
  2. 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.
  3. Create a class Rectangle with private attributes length and width. Overload ‘<’ operator to compare the area of 2 rectangles.
  4. Create a class Time with private attributes hour, minute and second. Overload ‘+’ operator to find sum of 2 time.
  5. 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.

Course Outcome 5 (CO5):

  1. Write a Python program to read a file line by line and store it into a list.
  2. Python program to copy odd lines of one file to other
  3. Write a Python program to read each row from a given csv file and print a list of strings.
  4. Write a Python program to read specific columns of a given CSV file and print the content of the columns.
  5. 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages