예제 #1
0
 def test_argument_unpacked_list(self):
     """ Current arg is list. TypeError  """
     self.assertIsNotNone(fib.fibon(*[5]))
예제 #2
0
 def test_not_none(self):
     """ Is return not None """
     self.assertIsNotNone(fib.fibon(10))
예제 #3
0
 def test_argument_unpacked_dict(self):
     """ Current arg is dict. TypeError  """
     self.assertIsNotNone(fib.fibon(**{'num_of_members': 5}))
예제 #4
0
 def test_fibon_equal(self):
     """ Is return value is equal with example """
     self.assertEqual(fib.fibon(10), [1, 1, 2, 3, 5, 8, 13, 21, 34, 55])
예제 #5
0
 def test_return_amount(self):
     """ Correct return length """
     self.assertEqual(len(fib.fibon(10)), 10)
예제 #6
0
newdict['vaibhav'] = 5525
print(newdict)
print(newdict['sage'])
print(list(newdict.keys()))
print(sorted(newdict.keys()))

newdict2 = dict(sape=4139, guido=4127, jack=4098)
print(newdict2)
for k, v in newdict2.items():
    print(k, v)

for i, v in enumerate(newdict2):
    print(i, v)

import fibonacci as f11
f11.fibon(1000)
print(f11.__name__)

print('{0} and {1}'.format('spam', 'eggs'))
contents = 'eels'
print('My hovercraft is full of {!r}.'.format(contents))

print('start file')
f = open('resources/out.csv')
for line in f:
    print(line)
print('end file')

f = open('resources/workfile', 'rb+')
print(f.write(b'abcdefghijklmnop'))
print(f.seek(5))
예제 #7
0
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 18 12:38:02 2020

@author: CEC
"""

import fibonacci
fibonacci.fibon(10000)