So I tried to write a simple program that calculates your BMI.
The program worked ok, but I couldn’t manage to add a string to the result that says (here is the result) “: is your BMI”
Its probably a very obvious mistake im making, but Im very new to pyhton, or any programming language.
Heres the code;
height = input("Your height in meters (1.72 for example) ")
weight = input("Your weight ")
height2 = float(height) * float(height)
bmi = (float(weight) / float(height2))
print(str(bmi)) + (“is your bmi”)
I’d appreciate if someone told me what is my major malfunction here, the problem is in how Im trying to involve the string at the end, if I remove it all is fine. But I’d like to know how to add a string there
Also Im new to the forum, sorry If this is in the wrong section, or im lacking etiquette.
You cannot join a print statement to a string as I see in you example code. The text is your bmi should be within the print statement. Do some research on f-strings. They are a pretty nice way to print output to the screen.