+ 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")
9th Mar 2022, 7:31 PM
Jayakrishna šŸ‡®šŸ‡³
+ 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
11th Mar 2022, 7:20 PM
Umar Farooq
+ 1
Or use , to break line between variables and strings
11th Mar 2022, 7:21 PM
Umar Farooq
0
You're welcome.. Python comment starts by # # single line comment or """ multi line Comment """
9th Mar 2022, 7:38 PM
Jayakrishna šŸ‡®šŸ‡³
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
9th Mar 2022, 9:19 PM
HungryTradie
HungryTradie - avatar
0
Might i suggest you add decimeters too becuase its also a length measurment
10th Mar 2022, 7:54 PM
Ethan Sunker
Ethan Sunker - avatar
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")
11th Mar 2022, 8:25 AM
Edwin Ayabie II
Edwin Ayabie II - avatar