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 8978001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:30:16+00:00 2026-06-15T19:30:16+00:00

My entire code is below (didn’t want to miss anything). For some reason I

  • 0

My entire code is below (didn’t want to miss anything). For some reason I keep getting an error where I can’t convert a float to an int?

import math

def getRange(input):
    if (1 <= input < 10):
        return [1,1,9]
    elif (10 <= input < 190):
        return [2,10,99]
    elif (190 <= input < 2890):
        return [3,100,999]
    elif (2890 <= input < 38890):
        return [4,1000,9999]
    elif (38890 <= input < 488890):
        return [5,10000,99999]
    elif (488890 <= input < 5888889):
        return [6,100000,999999]

def getDigit(input):
    workingRange=getRange(input)
    multi_digit_dec = ((input-workingRange[1])/workingRange[0])+workingRange[1]
    multi_digit_float = math.floor((input-workingRange[1])/workingRange[0])+workingRange[1]
    print multi_digit_float
    multi_digit_int = input(multi_digit_float)
    decimal_remainder = multi_digit_int - multi_digit_dec
##    digit_id = decimal_remainder * len(str(multi_digit_int))
##    actual_digit = str(multi_digit_dec)[digit_id]
##    return actual_digit


getDigit(100)

My error is:

Traceback (most recent call last):
  File "C:\Users\Samuel\Desktop\Python\concatenate string of variables and product values.py", line 29, in <module>
    getDigit(100)
  File "C:\Users\Samuel\Desktop\Python\concatenate string of variables and product values.py", line 22, in getDigit
    multi_digit_int = int(multi_digit_float)
TypeError: 'int' object is not callable
>>> 

Code updated above to reflect change of variable called int to input

  • 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-15T19:30:18+00:00Added an answer on June 15, 2026 at 7:30 pm

    The problem is that you’re using int as a variable name, and that shadows the built-in function. Rename the variable.

    In general, it’s worth familiarizing oneself with the names of the built-in functions, to avoid this type of problems.

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

Sidebar

Related Questions

Below is my entire code. When trying to execute it, I keep getting the
For some reason my code here (this is the entire thing) doesnt actually render
I have the below code and for some reason, rename(..) function is failing. I
Below is my entire code from a User control that contains the YUI Uploader.
EDIT: The entire code and database creation script can be found from http://gitorious.org/scheator .
My entire source code base is < 20MB. I want it all loaded in
I have download entire Eclipse Helios/Indigo version Source Code. Now I want to work
I'm trying to find out why this entire code below is producing only ONE
I have a setup similar to code below, where there can be any number
I have this piece of code where I'm trying to convert the below C#

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.