Skip to content
This repository has been archived by the owner on Oct 31, 2020. It is now read-only.

Commit

Permalink
feat: Add Problem-51 Python Source
Browse files Browse the repository at this point in the history
  • Loading branch information
aliemo committed May 23, 2020
1 parent 65a0b7a commit 2b57952
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions ProblemSets/PDS-ProblemSet-05/src/Problem51/fibo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""
--/*
--**********************************************************
-- Design Automation Course Homework (Spring, 2020 Semester)
-- Amirkabir University of Technology (Tehran Polytechnic)
-- Department of Computer Engineering (CE-AUT)
-- https://ce.aut.ac.ir
-- Created by TA (ali[dot]mohammadpour[at]ac[dot]ir)
-- *******************************************************
-- Student ID : XXXXXXX
-- Student Name: -----------------
-- Student Mail: -----------------
-- *******************************************************
-- Module: ProblemSet 5, Problem 1, Fibonacci Model
-- *******************************************************
-- Additional Comments:
--*/
"""

import math

# This Source is an example of fibonacci soft model

phi = (1.0 + math.sqrt(5))/ 2.0

def fibo(n=1):
return int( (phi ** n - (1 - phi) ** n) / math.sqrt(5))


for i in range(0, 15):
print(fibo(i))

0 comments on commit 2b57952

Please sign in to comment.