Skip to content

The-School-of-AI/session-5-assignment-ashishtiwari15

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Date of Assignment Completion

05th July 2024

Session Name

EPAi v5 - Functional Parameters

Author

Ashish Tiwari

Session Description

This Session aims at dealing with Functional Paramters in Python. Everything related to Python's Functions, its parts, the ways functions an be described, different ways of writing functions, Introspections, Callables and what they represent. Next, we checked out the different in-built methods like map, filter and Zip. Reduce is one of the important functions of the lot where in we can reduce an iterable to a single value. Partial Functions and Operators module were some other modules that were discussed.

Assignment Description

This assignment is pretty detailed and lengthy where in its expected to complete the session file as well as write the test cases. Following are the methods involved in the session file of the assignment.

  1. time_it(fn, *args, repetitions= 1, **kwargs) => This is a higher order function. Higher order functions are those that accept another function as input or produce a function as result. These are important when you wish to introduce some common function level operation like logging on multiple methods identically. According to description, this function needs to execute "fn" "repititions" number of times and get the average amount of time needed to execute the function.
  2. squared_power_list => Retruns list by raising number to power from start to end
  3. polygon_area => Retruns area of a regular polygon with number of sides between 3 to 6 both inclusive
  4. temp_converter => Converts temprature from celsius 'c' to fahrenheit 'f' or fahrenheit to celsius
  5. speed_converter => Converts speed from kmph (provided by user as input) to different units dist can be km/m/ft/yrd time can be ms/s/min/hr/day

Assignment Feedback

Too long! Cmon mang! But really interesting to complete all of it. The major challenge of this assigment is the length. logically it is not that complex This shall help in getting used to proper coding standard while writing python applications code. Things like docstrings, type hints, validations test cases shall be needed in every python application. One thing I want to add in this is logging, since all applications have logging in Python.

Assignment Approach

Following is the sequence I shall start working on for this assigment

  1. README File completion => Complete the Readme file with appropriate content and related test cases.
  2. time_it function completion => Complete the timeit function with the necessary details
  3. Othe functions and their solutions

Quiz

I happen to attempt the quiz in a haste, resulting in scores much closer to 60% than I want it to, but I shall pay more attention to completing them on a weekend to allow for better results.

Next Session

Will Update here once I check it out what's in it.

Solutions

All functions have validations of inputs, something that is necessary to allow for mandating the type of inputs that are given to the function. Will update more on this once I complete the Assignment.

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%