Can you please continue this series it clears the doubts so much with such an ease. Thanks for the video and please please please upload more such videos
Correction at 03:43 - It should be *Object of Dog Class* Not Animal class Because objects of the Animal class does not have access to attributes and methods of Dog Class.
class polygon(): def __init__(self, sides): self.sides = sides def display_info(self): print("the polygon is a two dimensional shape with straigt lines") def get_perimeter(self): perimeter = sum(self.sides) return perimeter class triangle(polygon): def display_info(self): print("the triangle is three sides of edges") class quadlilateral(polygon): def display_info(self): print("the quadlilateral is four sides of edges") t1 = triangle([3,4,5]) perimeter = t1.get_perimeter() print("The perimeter is", perimeter) here showed that the triangle has get_perimeter attributes, but I can't fix the error. Can u please help me?
We use comma in the print() function to print multiple objects. For example, print("Hello", "there") And, the . operator is used to access methods and attributes of an object. For example, my_list = [1, 2, 3] my_list.append(4) print(my_list)
IS THIS CODE RIGHT???? marks = int(input("enter your marks:")) number_of_subjects = int(input("enter no. of subjects:")) class marks_obtained(): def __init__(self,name,marks,number_of_subjects): self.name = name self.marks = marks self.number_of_subjects = number_of_subjects def percent_obtained(self): total = self.marks/self.number_of_subjects percentile = total*100 print("self.name has scurred :" ,percentile) return percentile def rank_securred(self): if percentile >=90: print("self.name has got an A ") elif 90 >percentile>=80: print("self.name has got B") else : print("self.name has got C") return rank class student_1(marks_obtained): pass c1 = student_1("Harry",marks,number_of_subjects) percentile = student_1.percent_obtained() rank = student_1.rank_securred()
write a program to calculate the total amount payable by the customer on purchase of any item with GST lived on it develop a user friendly approach using while loop Bro iska source code bata do Ya phir kisi ko bhi ata ho toh bata do plz
HOPE THIS HELP!!! # write a program to calculate the total amount payable by the customer on purchase of any item with GST lived on it develop a user friendly approach using while loop class Amount_payable(): def __init__(self,name,cost_of_item): self.name = name self.cost_of_item = cost_of_item def total_amount(self): GST = 10.3 if self.cost_of_item > 1000: final_amount = self.cost_of_item + GST print(final_amount) else: print("its GST free") return pay class Customer(Amount_payable): pass c1 = Customer("janet", 50000) pay = c1.total_amount() print(pay) class Customer2(Amount_payable): pass c2 = Customer2("harry",100) pay = c2.total_amount() print(pay)
🔥 Learn Python with a more hands-on experience with Programiz PRO-interactive lessons, quizzes & challenges.
Try Programiz PRO: bit.ly/right-python
Just brilliant! I have understood everything as a complete beginner. Thank you!
Your videos are so underrated, have learnt complex topics like OOPS in a matter of few days. Thanks
Programiz is a good place to learn. Thanks a lot for your help
Can you please continue this series it clears the doubts so much with such an ease. Thanks for the video and please please please upload more such videos
Too good ! Please add lectures on Abstraction, Encapsulation and Polymorphism also.
Correction at 03:43 - It should be *Object of Dog Class*
Not Animal class
Because objects of the Animal class does not have access to attributes and methods of Dog Class.
super explanation. Nothing was getting inside my mind before watching this. really wonderfull!!
Please make videos on Multiple Inheritance and Operator overloading as well
Can you please continue the series sir ,its easy to understand the way you teach
This is the first Indian guy that I actually enjoy listening.
Thanks for all your info truly amazing....Bless up and keep up the Great Work....
I clearly understand the OOP here. Thanks dude.!
Respect your content 😊😊
Simple explanation , thanks...
Thank you! This was a very helpful video
Your explanation is really very good
Please make all videos on Oops concept s
Happy Programming!😇
class polygon():
def __init__(self, sides):
self.sides = sides
def display_info(self):
print("the polygon is a two dimensional shape with straigt lines")
def get_perimeter(self):
perimeter = sum(self.sides)
return perimeter
class triangle(polygon):
def display_info(self):
print("the triangle is three sides of edges")
class quadlilateral(polygon):
def display_info(self):
print("the quadlilateral is four sides of edges")
t1 = triangle([3,4,5])
perimeter = t1.get_perimeter()
print("The perimeter is", perimeter)
here showed that the triangle has get_perimeter attributes, but I can't fix the error. Can u please help me?
you didnt give space known as indendation in the class polygon methods if you space in methods of the class polygon your program will correct
great explanation
waiting for abstraction and encapsulation #askprogrammiz
Which text editor do you guys use?😀 #askprogramiz
This helped me so much...thank you
Can u please create one video about polymorphism, encapsulation and abstraction please...
What is this class... when will u start Python modules??
Yeah, this is getting hard... :D
Should we have to give "object" to function name ??
Here dog1 for dog?
what does argument (self) mean ?
10:11 why comma and not dot??
We use comma in the print() function to print multiple objects. For example,
print("Hello", "there")
And, the . operator is used to access methods and attributes of an object. For example,
my_list = [1, 2, 3]
my_list.append(4)
print(my_list)
Thanks alot;)
Always make sure that the spelling of every word must be correct.
IS THIS CODE RIGHT????
marks = int(input("enter your marks:"))
number_of_subjects = int(input("enter no. of subjects:"))
class marks_obtained():
def __init__(self,name,marks,number_of_subjects):
self.name = name
self.marks = marks
self.number_of_subjects = number_of_subjects
def percent_obtained(self):
total = self.marks/self.number_of_subjects
percentile = total*100
print("self.name has scurred :" ,percentile)
return percentile
def rank_securred(self):
if percentile >=90:
print("self.name has got an A ")
elif 90 >percentile>=80:
print("self.name has got B")
else :
print("self.name has got C")
return rank
class student_1(marks_obtained):
pass
c1 = student_1("Harry",marks,number_of_subjects)
percentile = student_1.percent_obtained()
rank = student_1.rank_securred()
you dint pass the marks and number of subjects arguments
write a program to calculate the total amount payable by the customer on purchase of any item with GST lived on it develop a user friendly approach using while loop
Bro iska source code bata do
Ya phir kisi ko bhi ata ho toh bata do plz
HOPE THIS HELP!!!
# write a program to calculate the total amount payable by the customer on purchase of any item with GST lived on it develop a user friendly approach using while loop
class Amount_payable():
def __init__(self,name,cost_of_item):
self.name = name
self.cost_of_item = cost_of_item
def total_amount(self):
GST = 10.3
if self.cost_of_item > 1000:
final_amount = self.cost_of_item + GST
print(final_amount)
else:
print("its GST free")
return pay
class Customer(Amount_payable):
pass
c1 = Customer("janet", 50000)
pay = c1.total_amount()
print(pay)
class Customer2(Amount_payable):
pass
c2 = Customer2("harry",100)
pay = c2.total_amount()
print(pay)