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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:35:06+00:00 2026-06-14T19:35:06+00:00

Sorry about my previous question. The question I have to answer is this: Body

  • 0

Sorry about my previous question. The question I have to answer is this:

Body Mass Index (BMI) is a good indicator of body fatness for most people. The formula for BMI is weight/ height2 where weight is in kilograms and height is in meters. Write a program that prompts for weight in pounds and height in inches, converts the values to metric, and then calculates and displays the BMI value.

What I have so far is this:

"""
BMI Calculator

1. Obtain weight in pounds and height in inches
2. Convert weight to kilograms and height to meters
3. Calculate BMI with the formula weight/height^2
"""

#prompt user for input from keyboard
weight= input ("How much do you weigh (in pounds)?")
#this get's the person's weight in pounds

weight_in_kg= weight/2.2
#this converts weight to kilograms

height= input ("What is your height (in inches)?")
#this gets the person's height in inches

height_in_meter=height*2.54
#this converts height to meters

bmi=weight_in_kg/(height_in_meters*2)
#this calculates BMI

print (BMI)

My first step works, but that is the easy part. I know that in Python the equal sign assigns something, so I’m not sure if that is the problem, but I really do not know what to do. I am really sorry. When I run the program it says:

TypeError : unsupported operand type(s) for /: ‘str’ and ‘float’

If anyone could give me any tips on what I am doing wrong, I would really appreciate it. And if not, thank you for your time. Thanks again.

  • 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-14T19:35:07+00:00Added an answer on June 14, 2026 at 7:35 pm

    For Python 3.x (as specified):

    The problem is that keyboard input from input() is of type str (string), which is not a numeric type (even if the user types in numbers). However, this is easily fixed by changing the input lines like so:

    weight = float(input("How much do you weigh (in pounds)?"))
    

    and

    height = float(input("What is your height (in inches)?"))
    

    thus converting the string output of input() into the numeric float type.

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

Sidebar

Related Questions

me again. Sorry about this. Following on from my previous question (I think I
Sorry about the stupid question however I can't see/ not good enough to solve
Sorry about the extremely vague question title (any suggestions for improvements welcome) I have
Sorry about the wording for my question title. I have a basic HTML anchor
sorry about input mistakes, english its not my mother lang. I have this code
Hello yeah I'm asking this question a second time, sorry about that but I
Sorry about this question but i never worked with SQLite, and i gone through
Sorry about the wording of the question, I don't really know how to put
sorry about the last question. (I hate google traductor). Im working in a MMO
I have such class (sorry about posible mistakes, i'm writing it right here.) Class

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.