Giter VIP home page Giter VIP logo

lab_fun_week1's Introduction

lab_fun_week1

This is the submission for the weekly coding challenge.

Description

  1. The first part of the challenge was to write a single function in python that calculates the 5th, 10th and 100th numbers in the Fibonacci sequence and returns the numbers as outut (together).
  2. The second part of the challenge was to write a function in python that given a single number A, it returns the numbers in the Fibonacci sequence clsest to A and the two numbers in the Fibonacci sequence immediately smaller and higher than A.

Approach

The criteria for the best code are:

  • Speed of processing
  • Max memory usage
  • Coding style

Regarding speed processing and memory usage it is pretty straightforward when knowing code optimization. Therefore, an effort has been put on coding style:

When developing software, it's vital for the programmer to prioritize code readability and user-friendliness. It's essential to remember that the end user might not have any coding expertise. As such, the software should be designed to be as intuitive as possible, without necessitating specialized tools like IDEs or compilers. Incorporating a graphical user interface that provides clear instructions on how to use the software and what inputs are required is crucial. With this perspective in mind, the software has been crafted to offer all essential information, ensuring easy accessibility and optimizing the user experience.

Instructions

  1. Create a folder
  2. Download this code in the created folder.
  3. Go to your created folder and open the terminal there
    • For windows user Hold Shift + Right Click the folder you want it opened on, and click "open command window here".
    • For Unix user open the terminal and type cd myfolder press enter. Replace the name myfolder by the name of the folder you just created.
  4. Two solution to run the program:
    • Drag and drop the program Fibonacci.py in the terminal prompt
    • Run in your terminal
python Fibonacci.py
  1. Follow the instruction.

Output

The program will give:

  • The average time and its standard deviation to run the specific function (ran 10000 times)
  • The maximum memory usage

The output is in this form:

================================================================
ELAPSED TIME:
MEAN:1.2439966201782226e-06 +/- 7.882864856002769e-07 SECONDS
MAX MEMORY USAGE:
/Users/samuel/Desktop/Fibonacci.py:116: size=92 B, count=3, average=31 B
================================================================

The 5 10 and 100th Fibonacci numbers are 5 55 and 354224848179263111168.

lab_fun_week1's People

Contributors

sam54000 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.