Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Problems with inheritance with classes
#4
This drives me nuts to see in python
Quote:
print(self.name.title() + " " + "is an " + self.cuisine.title()+ " " + "restaurant")

As it should be
print(f'{self.name.title()} is an {self.cuisine.title()} restaurant')
or at the very worst if they dont have python3.6+
print('{} is an {} restaurant'.format(self.name.title(), self.cuisine.title()))
ThomasL, noisefloor, micseydel like this post
Quote

Top Page

Messages In This Thread
RE: Problems with inheritance with classes - by metulburr - Jul-04-2019, 11:59 AM

Possibly Related Threads...
Thread Author Replies Views Last Post
  Unexpected Output using classes and inheritance langley 2 207 Jul-04-2019, 09:33 AM
Last Post: langley
  Inheritance Athul 7 749 Aug-11-2018, 06:48 PM
Last Post: yksingh1097
  inheritance Arifattal 3 989 Jan-15-2018, 02:52 PM
Last Post: Arifattal
  Problems with importing classes in different folder Xeraphim 3 1,000 Nov-08-2017, 03:20 PM
Last Post: Larz60+
  Using classes? Can I just use classes to structure code? muteboy 5 1,413 Nov-01-2017, 04:20 PM
Last Post: metulburr

Forum Jump:


Users browsing this thread: 1 Guest(s)