+ 2
#Put camma in between print function arguments...
mm = float(input())
cm = mm*10.0
dm = cm*10.0
m = dm*10.0
km = m*1000.0
print( mm, "mm is equal to:")
print( cm ,"cm")
print( dm, "dm")
print( m ,"m")
print( km, "km")
+ 1
mm = float(input())
cm = mm*10.0
dm = cm*10.0
m = dm*10.0
km = m*1000.0
print( str(mm) + "mm is equal to:")
print( str(cm)+ "cm")
print( str(dm) +"dm")
print( str(m) +"m")
print( str(km)+ "km")
Fixes:
1-add + operator in print function to concatenate a variable and a string
2-convert your variable values to string from float using str() function
+ 1
Or use , to break line between variables and strings
0
You're welcome..
Python comment starts by #
# single line comment
or
"""
multi line Comment
"""
0
G'day Shalomdev congratulations on getting the code to do what you wanted. Do you love the way Python can do things so elegantly?
Would you do a bit of housekeeping, edit your original post to start with [Solved]?
Have you found the Q&A search bar (it is the magnifying glass icon at the top of the discuss screen)? Did you know you can link other Q&A posts or SoloLearn code bits (use the plus icon)?
https://www.sololearn.com/discuss/1316935/?ref=app
https://www.sololearn.com/discuss/333866/?ref=app
0
Might i suggest you add decimeters too becuase its also a length measurment
0
mm = float(input())
cm = mm*10.0
dm = cm*10.0
m = dm*10.0
km = m*1000.0
print( mm, "mm is equal to:")
print( cm, "cm")
print( dm, "dm")
print( m, "m")
print( km, "km")