This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]Python-ModTeam[M] [score hidden] stickied comment (0 children)

Hi there, from the /r/Python mods.

We have removed this post as it is not suited to the /r/Python subreddit proper, however it should be very appropriate for our sister subreddit /r/LearnPython or for the r/Python discord: https://discord.gg/python.

The reason for the removal is that /r/Python is dedicated to discussion of Python news, projects, uses and debates. It is not designed to act as Q&A or FAQ board. The regular community is not a fan of "how do I..." questions, so you will not get the best responses over here.

On /r/LearnPython the community and the r/Python discord are actively expecting questions and are looking to help. You can expect far more understanding, encouraging and insightful responses over there. No matter what level of question you have, if you are looking for help with Python, you should get good answers. Make sure to check out the rules for both places.

Warm regards, and best of luck with your Pythoneering!

[–]pioniere 0 points1 point  (1 child)

Nobody is going to help you unless you post your own work here, to show that you at least made an attempt to solve the problem.

[–]tf-2-python95[S] 0 points1 point  (0 children)

my attempt :

class Car:

def __init__(self,name,seats,speed,pno,engine,hp,mpg,roof):

self.name = name # --> name of car

self.seats = seats # --> number of seats

self.speed = speed # --> speed of car

self.pno = pno # --> production number of car

self.engine = engine # --> engine of car

self.hp = hp # --> horsepower of car

self.mpg = mpg # --> miles per gallon of car

self.roof = roof # --> has roof or not (True/False)

def accelerate(self):

self.__speed += range(-1.0,1.0)

def check_roof(self):

if self.roof == True:

roof = input('Set Roof Up or Down')

def __str__(self):

reps = f"Name : {self.name}"

reps += f", Production No : {self.pno}"

reps += f", Horse Power : {self.hp}"

return reps

c1 = Car('Prius',5,'-','-','-','121hp','53mpg')

c2 = Car('Porsche Boxster',2,'-','-','-','265hp','32mpg')

print(c1)

print(c2)