def test_fib(): assert fib(0) == 0 assert fib(1) == 1 assert fib(10) == 55
import module module.printFib(1000) result = module.fib(1000) print '\n\nresult: ', result
import module print('Ответ:', module.fib(int(input("Номер элемента ряда Фибоначчи: "))))
# -*- coding: utf-8 -*- """ Created on Sat Jan 18 12:07:56 2020 @author: CEC """ import module module.fib(n)
# import module from module import fib, fib2 print fib(1000) print fib2(1000)
# 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 == "*":
import module module.fib(50) print('-' * 40) print(module.fib2(100))
from module import printFib, fib printFib(1000) result = fib(1000) print '\n\nresult: ', result