コード例 #1
0
def test_fib():
    assert fib(0) == 0
    assert fib(1) == 1
    assert fib(10) == 55
コード例 #2
0
import module

module.printFib(1000)

result = module.fib(1000)
print '\n\nresult: ', result
コード例 #3
0
ファイル: fibonacci_with_mem.py プロジェクト: TIIGR/WorkSpace
import module

print('Ответ:', module.fib(int(input("Номер элемента ряда Фибоначчи: "))))
コード例 #4
0
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 18 12:07:56 2020

@author: CEC
"""

import module
module.fib(n)
コード例 #5
0
# import module
from module import fib, fib2

print fib(1000)
print fib2(1000)
コード例 #6
0
# Initial startup displaying zero
module.display(firstNumber)

# Request 3 user input for first number
firstNumber = module.reqInput(" Please enter the first number: ")
# Call fancy display function to show the user input
module.display(firstNumber)

# Request 3 user input for operator
operator = module.reqInput2(" Please enter the operator(+,-,*,/,^,?,!): ")
module.display(operator)

# If ? or ! we do not need a second number, so we stop here
if operator == "?":
    module.display(module.fib(int(firstNumber)))
elif operator == "!":
    module.display(module.Other(int(firstNumber)))
# Was neither of those so we need a second number
else:
    # Request 3 user input for second number
    secondNumber = module.reqInput(" Please enter the second number: ")
    module.display(secondNumber)

    if operator == "+":
        module.display(module.Addition(int(firstNumber), int(secondNumber)))
    elif operator == "-":
        module.display(module.Subtraction(int(firstNumber), int(secondNumber)))
    elif operator == "/":
        module.display(module.Division(int(firstNumber), int(secondNumber)))
    elif operator == "*":
コード例 #7
0
import module

module.fib(50)
print('-' * 40)
print(module.fib2(100))
コード例 #8
0
from module import printFib, fib

printFib(1000)

result = fib(1000)
print '\n\nresult: ', result