Skip to content

rohith20-source/Python-College-Assignments

 
 

Repository files navigation

Python-College-Assignments

Python Fundamentals assignments to be performed in college

  1. Create a list of different data fields and use appropriate Python data types to represent each of them. (Case study: - You are required to design the data structure to display the individual player stats for cricket players. A player may have represented more than one team and may have played in more than one format such as Test, ODI and T20)

  2. Assume that there are the top 5 performers. Write a Python program to decide the player with the highest points. Develop separate functions to compute batting and bowling points and save them in a module. The performance of each player is stored in a dictionary object. These functions should be imported into the main code. (Case Study: - The 'Man of the Match' award of a 50-over cricket match is decided by computing points earned by players. The points are calculated on the basis of the following rules:
    Batting
    • 1 point for 2 runs scored
    • Additional 5 points for half century • Additional 10 points for century • 2 points for strike rate (runs/balls faced) of 80-100 • Additional 4 points for strike rate>100
    • 1 point for hitting a boundary (four) and 2 points for over boundary (six)

          Bowling                        
          • 10 points for each wicket                        
          • Additional 5 points for three wickets per innings                
          • Additional 10 points for 5 wickets or more in innings            
          • 4 points for economy rate (runs given per over) between 3.5 and 4.5                        
          • 7 points for economy rate between 2 and 3.5                                   • 10 points for economy rate less than 2                
         
         Fielding                        
          • 10 points each for catch/stumping/run out 
    
  3. Design a ‘book’ class with title, author, publisher, price and author’s royalty as instance variables. Provide getter and setter properties for all variables. Also define a method royalty() to calculate royalty amount author can expect to receive the following royalties:10% of the retail price on the first 500 copies; 12.5% for the next 1,000 copies sold, then 15% for all further copies sold. Then design a new ‘ebook’ class inherited from ‘book’ class. Add ebook format (EPUB, PDF, MOBI etc) as additional instance variable in inherited class. Override royalty() method to deduct GST @12% on ebooks

  4. Write a python program to perform operations on stack

  5. Write a python program to perform operations on queue.

  6. Write a python function which accepts two linked lists containing integer data and an integer, n and merges two linked lists, such that list2 is merged with the list1 after n number of nodes.

  7. Write a python function which accepts a stack of integers, sort it in ascending order and return the sorted stack.

About

Python Fundamentals assignments to be performed in college

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 100.0%