Exemplo n.º 1
0
def test_fib():
    assert fib(0) == 0
    assert fib(1) == 1
    assert fib(10) == 55
Exemplo n.º 2
0
import module

module.printFib(1000)

result = module.fib(1000)
print '\n\nresult: ', result
Exemplo n.º 3
0
import module

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

@author: CEC
"""

import module
module.fib(n)
Exemplo n.º 5
0
# import module
from module import fib, fib2

print fib(1000)
print fib2(1000)
Exemplo n.º 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 == "*":
Exemplo n.º 7
0
import module

module.fib(50)
print('-' * 40)
print(module.fib2(100))
Exemplo n.º 8
0
from module import printFib, fib

printFib(1000)

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