Skip to content

Vika_task4_class_auto - #66

Open
victoriazubyk wants to merge 2 commits into
masterfrom
vika_task4_class_auto
Open

Vika_task4_class_auto#66
victoriazubyk wants to merge 2 commits into
masterfrom
vika_task4_class_auto

Conversation

@victoriazubyk

Copy link
Copy Markdown
Collaborator

add task 4

@victoriazubyk victoriazubyk changed the title Vika task4 class auto Vika_task4_class_auto Nov 21, 2018
@@ -0,0 +1,39 @@
class Auto:
def __init__(self,type , model,year,max_speed ):
self.type = type

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bad idea to create variables with names same as builtin functions.

Follow this list to know them:

https://docs.python.org/2/library/functions.html

return self.type

def change_type(self, new_type):
if (new_type != self.type):

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really need these brackets?

super().__init__(type, model, year, max_speed)

def get_car_type(self):
print('gas')

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest you to use return instead of print.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants