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

  • Home
  • SEARCH
  • 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 6096307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:54:44+00:00 2026-05-23T12:54:44+00:00

This error is referring to sstax= grosspay*SS_TAX. I don’t know what I’m doing wrong.

  • 0

This error is referring to “sstax= grosspay*SS_TAX”. I don’t know what I’m doing wrong. ): After changing the global constants to integers I got another error that said ‘TypeError: can only concatenate tuple (not “float”) to tuple’ referring to “netpay=(grosspay)-(sstax+fedtax+statetax)”.
Here’s my code:

HOURS_IN_WEEK=40.0
PAY_RATE=16.78
SS_TAX=0.075
FED_INC_TAX=0.014
STATE_LOC_TAX=0.08
UNIONDUES=10.0
HEALTH_INS=35.0

def getInfo():
    hrs=float(input("How many hours did you work this week?: "))
    dependents=float(input("How many dependents do you have?: "))
    if hrs > HOURS_IN_WEEK and dependents >= 3.0:
        overtime=hrs-HOURS_IN_WEEK
        overpay=overtime *(PAY_RATE*1.5)
        pay=(HOURS_IN_WEEK*PAY_RATE)
        grosspay= overpay+pay
        grosspay= grosspay-HEALTH_INS
    else:
        pay = hrs * PAY_RATE
        grosspay = pay
        print grosspay
    return grosspay,hrs,dependents

def tax(grosspay):
    sstax= grosspay*SS_TAX
    fedtax= grosspay*FED_INC_TAX
    statetax=grosspay*STATE_LOC_TAX
    netpay=(grosspay)-(sstax+fedtax+statetax)

    print sstax
    print fedtax
    print statetax
    print grosspay
    print netpay

def main():
    grosspay=getInfo()
    tax(grosspay)

main()
  • 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-05-23T12:54:45+00:00Added an answer on May 23, 2026 at 12:54 pm

    There error says that you can’t multiply a sequence by anything that is not an integer.

    You are returning a sequence in the getInfo() function:

    return grosspay,hrs,dependents
    

    This is equivalent to:

    return [grosspay, hrs, dependents]
    

    In Python, when you multiply a sequence by an integer, you duplicate the sequence:

    >>> [1, 2, 3] * 3
    [1, 2, 3, 1, 2, 3, 1, 2, 3]
    

    Multiplying by a float makes little sense, which is why the error arises.

    You can fix it by referencing one specific element of that list (you are after grosspay), so change this:

    def main():
        grosspay=getInfo()
        tax(grosspay)
    

    to this:

    def main():
        grosspay, hrs, dependents = getInfo()
        tax(grosspay)
    

    Now grosspay, hrs, and dependents are set and it should work fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting the following error after I start debugging my program. Do you know
I'm really struggling to understand why I'm getting this error. I'm getting it referring
This error is driving me crazy . I tried freenode #emberjs before asking here.
This error is driving me crazy. I'm developing an App Engine Python application. These
This error come in log. from='kutbi1@360degree/Smack' to='akash@360degree/Smack' type='error' id='hK1L6-5'> <si xmlns='http://jabber.org/protocol/si' id='jsi_191216212994140179' mime-type='image/png' profile='http://jabber.org/protocol/si/profile/file-transfer'>
this error is always fired, when i'm try to free my allocated struct the
This code gives me this error:Cannot implicitly convert type ArrayList[] to ArrayList[][] at this
Got this error message while trying to load view: The model item passed into
Getting this error: 2009-09-03 12:44:02.307 xcodebuild[307:10b] warning: compiler 'com.apple.compilers.llvm.clang.1_0.analyzer' is based on missing compiler
Getting this error with jquery & jquery.form. Site has been live for awhile..upgraded to

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.