Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Book.__init__() missing 5 required positional arguments

class Animal:

    def __init__(self, *, name, legs, place, move, weight, length, **kwargs):
        super().__init__(**kwargs)
        self.name = name
        self.legs = legs
        self.place = place
        self.move = move
        self.weight = weight
        self.length = length

    def __str__(self):
        return "Name: {}
Legs: {}
Place: {}
Move: {}
Weight: {}
Length: {}".format(self.name, self.legs, self.place, self.move, self.weight, self.length)

    def add_info(self):
        info_name = input("Enter name")
        info_legs = input("Enter how many legs this animal have")
        info_place = input("Enter where this animal live")
        info_move = input("Enter how move this animal")
        info_weight = input("Enter Weight")
        info_length = input("Enter length")

        self.name = info_name
        self.legs = info_legs
        self.place = info_place
        self.move = info_move
        self.weight = info_weight
        self.length = info_length
Comment

PREVIOUS NEXT
Code Example
Python :: python interate with two list 
Python :: BMI CALCULATOR CODE IN PYTHON 
Python :: python 2 factor authentication 
Python :: big python code 
Python :: how to open local software using python 
Python :: web3.eth.personal.newAccount(password, [callback]) 
Python :: Plotting a dendrogram 
Python :: csv/gpd to shapefile python 
Python :: sample stochastic gradient boosting regressor algorithm 
Python :: scatter plot python color according to gender 
Python :: change legend facecolor 
Python :: how to install python on linux chromebook 
Python :: appropriate graph for data visualization 
Python :: buscar elemento en lista python 
Python :: django error column last_login cannot be null 
Python :: ex: git push new local repo 
Python :: 1046 - Game Time 
Python :: windows py SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate 
Python :: how to get scrapy output file in xml file 
Python :: give colour to the font in python email message 
Python :: how to get single element from arraylist in numpy arrayt 
Python :: online python formatter and compiler 
Python :: python lxml get parent 
Python :: how to correct spelling in pandas datafeame 
Python :: using -h on python file 
Python :: how to open a different version of python on my macc 
Python :: pyspark rdd sort by value descending 
Python :: Returns the cartesian product with another DataFrame 
Python :: data wrangling python 
Python :: Return the indices of the bins 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =