18. for i in range(len(comp)):
19. if comp[i] == char:
20. comp = comp[0:i] + comp[i+1:]
21. found = True
22. break
23. if not found:
24. return False
25. return True if len(comp) == 0 else False
Looge ka fail ~/projekt1/anagram_tests.py sisuga
1. import unittest
2. import anagram
3.
4. class Tests(unittest.TestCase):
5. def test_different_length_strings(self):
6. self.assertEqual(anagram.anagram("hallo", "kosmos"), False)
7.
8. if __name__ == "__main__":
9. unittest.main()
6) Lisage loodud failid GIT salve
1. cd ~/projekt1
2.
3. git add -A
4.
5. git commit -m "Failid gitti imporditud"
Käske täites jälgige Giti suuniseid meiliaadressi, kasutaja tegeliku nime ja ka vaikimisi harude