diff --git a/lesson02/exercise2.py b/lesson02/exercise2.py index 6d7a91a..3f0f938 100644 --- a/lesson02/exercise2.py +++ b/lesson02/exercise2.py @@ -1,4 +1,5 @@ print(1+2*3) print(3/2*7) print(3**2*7/2) -print(3-2*7+2) \ No newline at end of file +print(3-2*7+2) +print(3-2*(7+2)) diff --git a/lesson02/string_concatenation3.py b/lesson02/string_concatenation3.py index bfc4981..803ab3c 100644 --- a/lesson02/string_concatenation3.py +++ b/lesson02/string_concatenation3.py @@ -1,3 +1,4 @@ name = "Alan" surname = "Turing" -print(name + " " + surname) +full_name = name + " " + surname +print(full_name) diff --git a/lesson09/string.escape.characters.py b/lesson09/string.escape.characters.py index d07afb3..a9b5a69 100644 --- a/lesson09/string.escape.characters.py +++ b/lesson09/string.escape.characters.py @@ -3,5 +3,3 @@ print("tabs:\n\t|\t|a\t|aa\t|aaa\t|") print("change line: \n newline \r CR") print("Backspace: bb\baa\bc\b\baa\b") - -ba \ No newline at end of file diff --git a/lesson11/local2.py b/lesson11/local2.py new file mode 100644 index 0000000..667adc5 --- /dev/null +++ b/lesson11/local2.py @@ -0,0 +1,7 @@ +#local2.py +def f(): + x = 5 + + +f() +print(x) diff --git a/lesson11/mutable.arguments.assignment.py b/lesson11/mutable.arguments.assignment.py index 457a0ea..6499e09 100644 --- a/lesson11/mutable.arguments.assignment.py +++ b/lesson11/mutable.arguments.assignment.py @@ -1,3 +1,4 @@ +# mutable.arguments.assignment.py def f(arg): print(arg) arg = [3] @@ -6,4 +7,4 @@ def f(arg): l = [1,2] print(l) f(l) -print(l) \ No newline at end of file +print(l) diff --git a/lesson16/private.py b/lesson16/private.py index 1357f03..e14c95e 100644 --- a/lesson16/private.py +++ b/lesson16/private.py @@ -1,4 +1,4 @@ -# public.py +# private.py class Cow: def __init__(self, weight, hunger): self.weight = weight @@ -14,4 +14,4 @@ def express(self): molly = Cow(100, 5) print(molly.__hunger) print(molly.weight) -molly.express() \ No newline at end of file +molly.express() diff --git a/lesson17/lesson17.exercise13/character.py b/lesson17/lesson17.exercise13/character.py index 0b0a20c..213e81e 100644 --- a/lesson17/lesson17.exercise13/character.py +++ b/lesson17/lesson17.exercise13/character.py @@ -1,4 +1,3 @@ -from equipment import Equipment from random import randrange @@ -34,4 +33,4 @@ def __iadd__(self, other): def __isub__(self, other): self.health -= other - return self \ No newline at end of file + return self diff --git a/lesson18/exercise10.py b/lesson18/exercise10.py index d7abff6..3fb6d5e 100644 --- a/lesson18/exercise10.py +++ b/lesson18/exercise10.py @@ -24,6 +24,7 @@ def perimeter(self): class Resizable(ABC): + @abstractmethod def resize(self, param): pass diff --git a/lesson19/lesson19.exercise05/pupils.py b/lesson19/lesson19.exercise05/pupils.py index 19aeef0..150aa39 100644 --- a/lesson19/lesson19.exercise05/pupils.py +++ b/lesson19/lesson19.exercise05/pupils.py @@ -113,7 +113,7 @@ def delete_pupil_by_id(self, pupil_id): print("Pupil deleted!") return else: - print("No teacher with this id!") + print("No pupil with this id!") def print_pupils_names(self): for pupil in self.pupils: