Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7956179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:55:04+00:00 2026-06-04T03:55:04+00:00

Code below, not sure what i’m doing wrong. It is an employee database. The

  • 0

Code below, not sure what i’m doing wrong. It is an employee database. The below inherits from from the Employee class. Not really sure what to do to get it to pass, unless my code is just wrong. I get this error ” SyntaxError: non-keyword arg after keyword arg”

class Manager(EmpSalaried): #inherits from EmpSalaried 
    def __init__(self, salary=0.0, firstName="", lastName="", ssID="", DOB=datetime.fromordinal(1), 
            startDate=datetime.today(), 
            manage=[]): #manage attribute added for manager
        Employee.__init__(self, salary, firstName, lastName, ssID, DOB, startDate)
        self.manage = manage


    def __str__(self):
        """
        >>> import datetime
        >>> e = Manager(10, 'Bob', 'Quux', '123', startDate=datetime.datetime(2009, 1, 1),          
        ['Michael', 'Bob', 'Hello'])
        >>> print e
        10, Bob Quux, 123, 0001-01-01 00:00:00, 2009-01-01 00:00:00, Michael, Bob, Hello
        >>> b = Manager(2000, 'Bob', 'Lol', '1234', startDate=datetime.datetime(2009, 1, 1),     
        ['Michael', 'Bob', 'Hello'])
        >>> print b
        2000, Bob Lol, 1234, 0001-01-01 00:00:00, 2009-01-01 00:00:00

        """
        return Employee.__str__(self) + ', ' + str(self.manage) #need to convert to a string in order to add to string
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T03:55:06+00:00Added an answer on June 4, 2026 at 3:55 am

    Doctests are formatted in just the same way as you would run an interactive session. You can run an interactive session and just copy it and you’ll get all the results. This might be one valid session:

    >>> import datetime
    >>> print Manager(10, 'Bob', 'Quux', '123', datetime.datetime(2009, 1, 1),
    ... ['Michael', 'Bob', 'Hello'])
    10, Bob Quux, 123, 0001-01-01 00:00:00, 2009-01-01 00:00:00, Michael, Bob, Hello
    >>> print Manager(2000, 'Bob', 'Lol', '1234', datetime.datetime(2009, 1, 1),     
    ... ['Michael', 'Bob', 'Hello'])
    2000, Bob Lol, 1234, 0001-01-01 00:00:00, 2009-01-01 00:00:00
    

    There were assorted syntax errors in what you had done;

    • For the doctest part of it, if you’re continuing the statement, the next line must start with ...  (exactly the same as in a regular session);
    • Your Manager instantiation was invalid (genuine Python SyntaxError) as you had startDate=... (a keyword argument) followed by a non-keyword argument (the value for “manager”). This is the main problem that stopped it from running. And that’s also what the exception told you.

    If you can’t figure it out in a doctest, run it in a normal Python session. Play with it there.

    There are also a number of other significant problems in your code; here are a couple of them:

    • EmpSalaried versus Employee: what gives with that?
    • Due to using a mutable default argument, if you don’t specify the manage argument when creating a Manager, they will get the same list. This is not what you want.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the following errors from the code below... not sure why (and yes,
Not sure how to do this. The code below does not work. From the
I've encountered code below and I'm not fully sure what it's achieving. I think
Below is my code, which behaves extremely bizarre, and I am not sure I
I'm not sure if I have the syntax correct in the code below, I'm
Not sure why the code below isn't working... I've tried a number of variations:
I'm not sure if the snippet of C++ code below is legitimate or not:
The code below seems to crash my app Not sure why Help appreciated. final
I'm not sure how to implement an onCancel/onDismiss listener to the code below. Could
Not sure if I'm phrasing my question right, but I have the code below.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.