Python Forum
[split] Class takes no arguments
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Class takes no arguments
#3
If you have a question, create a new post. Don't post your question as a reply to an existing post.

You create a class named Dog, then you create a different class and name it Dog. Finally you create yet a third class named Dog. If you want to create an instance of Dog and call the Dog methods, stop making new Dog classes.
#Making an Instance from a Class
my_dog = Dog('Atos', 8)
print("My dog name is " + my_dog.name.title() + ".")
print("My dog is " + str(my_dog.age) + " years old.")

my_dog.sit()
my_dog.roll_over()
Reply


Messages In This Thread
[split] Class takes no arguments - by bily071 - Oct-23-2023, 03:23 PM
RE: Class takes no arguments - by buran - Oct-23-2023, 03:55 PM
RE: Class takes no arguments - by deanhystad - Oct-23-2023, 03:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Class and methods ebn852_pan 2 157 May-12-2024, 08:07 AM
Last Post: Gribouillis
  Class test : good way to split methods into several files paul18fr 4 548 Jan-30-2024, 11:46 AM
Last Post: Pedroski55
  Error TypeError: output_type_handler() takes 2 positional arguments but 6 were given paulo79 1 2,007 Oct-17-2022, 06:29 PM
Last Post: paulo79
  Split Arguments ? jesse68 3 1,085 Jun-24-2022, 07:32 PM
Last Post: Larz60+
  Checking the number of arguments a function takes Chirumer 3 2,222 Jul-06-2021, 04:56 PM
Last Post: Chirumer
  Class Takes No Arguments horuscope42 4 4,900 Oct-26-2020, 11:10 PM
Last Post: not_username1234
  Class takes no arguments Nazartfya 2 4,644 Jun-27-2020, 12:45 PM
Last Post: Nazartfya
  Why Car() takes no arguments louis216 2 2,663 Jun-25-2020, 03:16 AM
Last Post: louis216
  random.choice() takes two positional arguments, but three were given. ShakeyPakey 5 11,832 May-31-2020, 03:13 PM
Last Post: deanhystad
  [split] Python Class Problem astral_travel 12 5,094 Apr-29-2020, 07:13 PM
Last Post: michael1789

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020