Computer Science (083): Python Important Programs for final practical

  1. Calculations
    1. Write program to input any number and to print all factors of that number.
    2. Write a program to input any number and to check whether given number is Armstrong or not. (Armstrong 1,153,etc. 13 =1 , 13+53 +33 =153)
    3. Write a program to input employee no, name basic pay and to find HRA, DA and netpay.
      Basic pay                   Hra Da
      >100000                   15% 8%
      <=100000&>50000 10% 5%
      <=50000                   5% 3%
    4. Write a program to find all prime numbers up to given number.
    5. Write a program to convert decimal number to binary.
    6. Write a program to convert binary to decimal.
    7. Write a program to input two complex numbers and to find sum of the given complex numbers.
    8. Write a program to input two complex numbers and to implement multiplication of the given complex numbers.
    9. Write a program to find sum of two distances with feet and inches.
    10. Write a program to find difference between two times with hours, minutes and seconds.
    11. Write a program to find the sum of all digits of the given number.
    12. Write a program to find the reverse of that number
  2. Strings
    1. Write a program to input username and password and to check whether the given username and password are correct or not.
    2. Which string method is used to implement the following:
      a) To count the number of characters in the string.
      b) To change the first character of the string in capital letter.
      c) To check whether given character is letter or a number.
      d) To change lower case to upper case letter.
      e) Change one character into another character.
    3. Write a program to input any string and to find number of words in the string.
    4. Write a program to input any two strings and to check whether given strings are equal are not.
  3. Lists/Tuple/Dictionary
    1. Write a program to input n numbers and to insert any number in a particular position.
    2. Write a program to input n numbers and to search any number.
    3. Sorting
  4. OOP
    1. Write a program to find area of following using function overloading.
      1. Area of circle (function with one parameter)
      2. Area of rectangle (function with two parameters)
      3. Area of triangle (function with three parameters)
    2. Write a program to find out volume of the following using function overloading.
      1. volume of cube
      2. volume of cuboid
      3. volume of cylinder
    3. Create the class SOCIETY with following information:
      An __init__ method to assign initial values of society_name as "Surya Apartments", flat as "A Type", house_no as 20, no_of_members as 3, income as 25000.
      Inputdata( ) - to read data members (society, house_no, no_of_members & income) and call allocate_flat().
      allocate_flat( ) - To allocate flat according to income
      Income                          Flat
      >=25000                      A Type
      >=20000 and <25000 B Type
      <15000                        C Type
      Showdata( ) - to display the details of the entire class.
    4. Define a class ITEMINFO in Python with the following description:
      ICode (Item Code)
      Item (Item Name)
      Price (Price of each item)
      Qty (quantity in stock)
      Discount (Discount percentage on the item)
      Netprice (Final Price)
      A member function FindDisc( ) to calculate discount as per the following rule:
      If Qty<=10 Discount is 0
      If Qty (11 to 20) Discount is 15
      If Qty>=20 Discount is 20
      A constructor( __init__ method) to assign the value with 0 for ICode, Price, Qty, Netprice and Discount and null for Item respectively
      A function Buy( ) to allow user to enter values for ICode, Item, Price, Qty and call function FindDisc( ) to calculate the discount and Netprice(Price*Qty-Discount).
      A Function ShowAll( ) to allow user to view the content of all the data members.
    5. Define a class furniture in Python with the given specifications:
      Instance variables:
      getType() To return instance variable Type
      getModel()To return instance variable Model
      show() To print instance variable Type and Model
      Define a class sofa:
      getSeats() To return instance variable No_of_seats
      getCost() To return instance variable Cost
      show() To print instance variable No_of_seats and Cost
      This class inherits class furniture
    6. Define a class student in Python with the given specifications:
      Instance variables:
      Roll number, name
      Getdata()- To input roll number and name
      Printdata()- To display roll number and name
      Define another class marks, which is derived from student class
      Instance variable
      Marks in five subjects
      Inputdata() - To call Getdata() and input 5 subjects marks.
      Outdata() - To call printdata() and to display 5 subjects marks.
  5. File Handling
    1. Creating copy of a file.
    2. Write a function that takes three argument 1st input file, 2nd output file and 3rd transformation function. First argument is the file opened for reading, second argument is the file opened for writing
      and third argument is a function, which takes single string and performs a transformation of your choice and returns the transformed string. The function should reed each line in the input file, pass
      the line through transformation function and then write transformed line to output file. A transformation can be - capitalize first alphabet of every word.
    3. Write a function to create a text file containing following data
      Neither apple nor pine are in pineapple. Boxing rings are square.
      Writers write, but fingers don't fing. Overlook and oversee are opposites. A house can burn up as it burns down. An alarm goes off by going on.
      i) Read back the entire file content using read() or readlines () and display on screen.
      ii) Append more text of your choice in the file and display the content of file with line numbers
      prefixed to line.
      iii) Display last line of file.
      iv) Display first line from 10th character onwards
      v) Read and display a line from the file. Ask user to provide the line number to be read.
    4. Create a dictionary having decimal equivalent of roman numerals. Store it in a binary file. Write a function to convert roman number to decimal equivalent using the binary file data.
    5. Write a program to delete the content provided by user from the binary file. The file is very large and can't fit in computers memory.
    6. Write a program to read a file 'Story.txt' and create another file, storing an index of Story.txt telling which line of the file each word appears in. If word appears more than once, then index should show all the line numbers containing the word.
      Hint : Dictionary with key as word(s) can be used to solve this.
    7. Write a function called replace file(), that takes pattern string, replacement string and two file names as argument. The function should read the first file and write the content into second file (creating it, if necessary). If the pattern string appear anywhere in first file, it should be replaced by replacement string in second file.
    8. Write a program to accept a filename from the user and display all the lines from the file which contain python comment character '#'.
    9. Reading a file line by line from beginning is a common task, what if you want to read a file backward. This happens when you need to read log files. Write a program to read and display content of file from end to beginning.
    10. Create a class item to store information of different items, existing in a shop. At least following is to be stored w.r.t. each item code, name, price, qty. Write a program to accept the data from user and store it permanently in the file. Also provide user with facility of searching and updating the data in file based on code of item.


  1. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Data Science with Python , kindly contact us
    MaxMunus Offer World Class Virtual Instructor led training on TECHNOLOGY. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us.
    Sangita Mohanty
    Skype id: training_maxmunus
    Ph:(0) 9738075708 / 080 - 41103383

    1. Hello Navadeep,

      Gratitude for putting up this prolific article! You truly make everything a cake walk. Genuinely good stuff, saving time and energy.

      I am new to python. I am trying trying to use it for the problem as follows:
      I have one file with 3 coloums of 32 bit data in hex representation. Second file is also 3 coloums but showing only one or two bits in binary representation that is my look up table.

      A higher-order function accepts one or more functions as input and returns a new function. Sometimes it is required to use function as data. To make high order function, we need to import functools module The functools.partial() function is used often for high order function.

      Comparing two files records in such a way that on each iteration from first file picking one combination of bits (2bits) for 3 fields in record compare them to record in look up table I.e file 2.
      File 1 record hex:
      A8000001 0000000 64000000

      File 2 data binary :
      10 00 01
      One iteration picks 01 compares to file2 first coloums data I.e 10 then file 1,2nd coloums 2 bits 00 with 2nd file 2nd coloums in same row it's 00. So on.
      Kindly suggest a solution or a hint how to implement it.

      It was cool to see your article pop up in my google search for the process yesterday. Great Guide.
      Keep up the good work!


  2. I feel really happy to have seen your webpage and look forward to so
    many more entertaining times reading here. Thanks once more for all
    the details. Besant technology offer Python training in Bangalore

  3. Thanks for one marvelous posting! I enjoyed reading it; you are a great
    author. I will make sure to bookmark your blog and may come back
    someday. I want to encourage that you continue your great posts, have
    a nice weekend!

    Selenium Training in Chennai

  4. My rather long internet look up has at the end of the day been compensated with pleasant insight to talk about with my family and friends.

    Java Training in Bangalore|

  5. My rather long internet look up has at the end of the day been compensated with pleasant insight to talk about with my family and friends. DevOps Training in Bangalore

  6. Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.

    AWS training in bangalore

  7. Nice information provided but i wanted to learn AWS from the starting and wanted to learn online.anybody want to study visit us this website .
    AWS Training in Bangalore

  8. Excellent Python Preparation
    Thank you for sharing please keep updating more on Python:
    Devops Training in Bangalore

  9. It has been simply incredibly generous with you to provide openly what exactly many individuals would’ve marketed for an eBook to end up making some cash for their end, primarily given that you could have tried it in the event you wanted.
    Besant technologies Marathahalli

  10. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition.

    Selenium Training in Chennai

    Selenium Training in Porur


  11. Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.

    Automation Anywhere Training in Chennai

  12. Ciitnoida provides Core and java training institute in noida. We have a team of experienced Java professionals who help our students learn Java with the help of Live Base Projects. The object-oriented, java training in noida , class-based build of Java has made it one of most popular programming languages and the demand of professionals with certification in Advance Java training is at an all-time high not just in India but foreign countries too.

    By helping our students understand the fundamentals and Advance concepts of Java, we prepare them for a successful programming career. With over 13 years of sound experience, we have successfully trained hundreds of students in Noida and have been able to turn ourselves into an institute for best Java training in Noida.

    java training institute in noida
    java training in noida
    best java training institute in noida
    java coaching in noida
    java institute in noida

  13. I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.

    amazon web services training in bangalore

  14. Thank you for the informative post. It was thoroughly helpful to me. Python Training in Hyderabad

  15. ERP-SAP-SD Training Centre in Noida

    CIIT Noida provides Best SAP Training in Noida based on current industry standards that helps attendees to secure placements in their dream jobs at MNCs. CIIT Provides Best ERP SAP Training in Noida. CIIT is one of the most credible ERP SAP training institutes in Noida offering hands on practical knowledge and full job assistance with basic as well as advanced level ERP SAP training courses. At CIIT ERP SAP training in noida is conducted by subject specialist corporate professionals with 7+ years of experience in managing real-time ERP SAP projects. CIIT implements a blend of aERPemic learning and practical sessions to give the student optimum exposure that aids in the transformation of naïve students into thorough professionals that are easily recruited within the industry.

    At CIIT’s well-equipped ERP SAP training center in Noida aspirants learn the skills for ERP SAP Basis, ERP SAP ABAP, ERP SAP APO, ERP SAP Business Intelligence (BI), ERP SAP FICO, ERP SAP HANA, ERP SAP Production Planning, ERP SAP Supply Chain Management, ERP SAP Supplier Relationship Management, ERP SAP Training on real time projects along with ERP SAP placement training. ERP SAP Training in Noida has been designed as per latest industry trends and keeping in mind the advanced ERP SAP course content and syllabus based on the professional requirement of the student; helping them to get placement in Multinational companies and achieve their career goals.

  16. The information which you have provided is very good. It is very useful who is looking for salesforce Online Training Hyderabad

  17. This comment has been removed by the author.

  18. thank you for sharing this type information nice blog python training in Hyderabad

  19. Webtrackker Technology is IT Company and also providing the Solidwork
    training in Noida at running project by the real time working trainers.
    If you are looking for the Best Solidwork training institute in Noida
    then you can contact to webtrackker technology.
    Webtrackker Technology
    C- 67, Sector- 63 (Noida)
    Phone: 0120-4330760, 8802820025
    Solidwork training institute in Noida

  20. mytectra placement Portal is a Web based portal brings Potentials Employers and myTectra Candidates on a common platform for placement assistance.

  21. Sap fico training institute in Noida

    Sap fico training institute in Noida - Webtrackker Technology is IT Company which is providing the web designing, development, mobile application, and sap installation, digital marketing service in Noida, India and out of India. Webtrackker is also providing the sap fico training in Noida with working trainers.

    C - 67, sector- 63, Noida, India.
    F -1 Sector 3 (Near Sector 16 metro station) Noida, India.

    +91 - 8802820025

  22. Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
    AWS Training in Chennai
    Data Science Training in Chennai
    Python Training in Chennai

  23. Really Good blog post provided helpful information. I hope that you will post more updates like this...
    Python Training Classes in Noida
    C C++ Training Institutes in Noida