-1

This is my very first question so don't be cruel, please :-) (I tried to find something in the questions database, but wasn't sucseed).

Could you please advise me how can I remove extra spase in the beginning of the line in the output - temperature in Farenheit? If it is possible - the solution for beginner.

celsius = input('Enter Celsius temperature:\n')
fahrenheit = (float(celsius)*(9/5))+32
print('Fahrenheit temperature:\n',fahrenheit)

Enter Celsius temperature:                                            
100                                                                   
Fahrenheit temperature:                                               
 212.0

Thank you in advance.

2 Answers2

0

You might set sep (separator) to empty str, as by default it is space, that is replace

print('Fahrenheit temperature:\n',fahrenheit)

using

print('Fahrenheit temperature:\n',fahrenheit,sep='')
Daweo
  • 31,313
  • 3
  • 12
  • 25
0

The print function puts a space separator in the output by default. You could either use two print statements to put the output on two separate lines, or provide an override value to remove the space.

print('Fahrenheit temperature:', fahrenheit, sep='\n')
Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880