Пример #1
0
 def test_reverse_list(self):
     head = Node(1)
     head.next = Node(2)
     head.next.next = Node(3)
     head.next.next.next = Node(4)
     self.assertEqual([4, 3, 2, 1], convert(reverse_list(head)))
     head = Node(1)
     head.next = Node(2)
     head.next.next = Node(3)
     head.next.next.next = Node(4)
     self.assertEqual([4, 3, 2, 1], convert(reverse_list_recursive(head)))
Пример #2
0
from reverse import reverse_list
import os

print(reverse_list([3,4,5,6]))


print( )
print(os.getpid())
print(os.getuid())
print(os.getcwd())

#alma_file=open("alma.txt", "w")
print( )
#print(alma_file.read())
#print(type(alma_file.read()))
#print(len(alma_file.read())) #??????
#alma_file.write('balozskam hol a kutya')
alma_file.close()
Пример #3
0
    def test_reverse(self):

        my_list = [1, 2, 3, 4, 5]

        assert reverse_list(my_list) == [5, 4, 3, 2, 1]
Пример #4
0
from reverse import reverse_list

import os

print(reverse_list([1, 2, 3]))
print(os.getcwd())

alma_file = open("alma.txt", "w")
print(alma_file.read())
alma_file.write("eper")
alma_file.close()