Skip to content
Snippets Groups Projects
Commit 1be075ab authored by Martin Mareš's avatar Martin Mareš
Browse files

Seznamy: Preferujeme is

parent d4b891f8
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,7 @@ class MyList: ...@@ -18,7 +18,7 @@ class MyList:
def append(self, x): def append(self, x):
"""Zapojí prvek se zadanou hodnotu na konec seznamu.""" """Zapojí prvek se zadanou hodnotu na konec seznamu."""
n = MyNode(x) n = MyNode(x)
if self.last: if self.last is not None:
self.last.next = n self.last.next = n
else: else:
self.first = n self.first = n
...@@ -26,7 +26,7 @@ class MyList: ...@@ -26,7 +26,7 @@ class MyList:
def print(self): def print(self):
n = self.first n = self.first
while n: while n is not None:
print(n.value) print(n.value)
n = n.next n = n.next
......
...@@ -22,7 +22,7 @@ class MyList: ...@@ -22,7 +22,7 @@ class MyList:
def print(self): def print(self):
n = self.first n = self.first
while n: while n is not None:
print(n.value) print(n.value)
n = n.next n = n.next
......
...@@ -43,7 +43,7 @@ class MyList: ...@@ -43,7 +43,7 @@ class MyList:
def print(self): def print(self):
n = self.head.next n = self.head.next
while n != self.head: while n is not self.head:
print(n.value) print(n.value)
n = n.next n = n.next
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment