Skip to content

The-School-of-AI/session-5-assignment-again-Anubis997

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Review Assignment Due Date Open in Visual Studio Code

epai5session5-template

The time_it(fn, *args, repetitions= 1, **kwargs) function:

The time_it function is designed to measure the average execution time of a given function over a given number of iterations. It takes as input the function fn and its location arguments *args and keyword arguments **kwargs. Also given is the number of iterations of the iterations, the default value is 1. It executes the operation multiple times, calculates the total elapsed time and returns the average execution time.

Squared_power_list function:

The squared_power_list function creates a list where each element is obtained by raising the given number to successive powers from start to finish. The default start and end values ​​are 0 and 5. Before enumerating the list, it makes sure that the number is positive and that the start and end are non-negative integers.

polygon_area function:

The polygon_area function calculates the area of ​​a regular polygon given its length and sides. It asserts that the sides are an integer between 3 and 6. Calculates and returns the area based on the specified length and sides using the regular polygon area formula.

temp_converter function:

The temp_converter function converts temperatures between Celsius 'c' and Fahrenheit 'f'. It needs the temp temperature and the temp_given_in flag to indicate the input temperature scale. This confirms that the temperature is a floating point number and ensures that the temperature is within the physically possible range of absolute zero. Based on the input scale, it does the correct conversion and returns the converted temperature.

speed_converter function:

The speed_converter function converts speeds from kilometers per hour to km/h to various other units such as meters per second ms, feet per second feet etc. It checks the input rate and rate to make sure it is a non-negative integer or float. It also checks that the distance distance and time units are set to valid options of km, m, ft, yrd for distance and ms, s, min, hr, day for time. Calculates and returns the converted rate based on the specified units using predefined conversion factors.

About

epai-5v-classroom-session-5-assignment-again-epai5session5-template created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%