188k views
0 votes
Help is greatly appreciated! I need a step but step explanation and a startup would be perfect.

Help is greatly appreciated! I need a step but step explanation and a startup would-example-1
Help is greatly appreciated! I need a step but step explanation and a startup would-example-1
Help is greatly appreciated! I need a step but step explanation and a startup would-example-2
User BjartN
by
7.8k points

1 Answer

4 votes

First Problem:

The point we should pay attention to in this section is the following;

  • The type of the variable that we will store the temperature from the user must be a float. Because in the formula we will use, an integer is not generated for every integer we give.

Below is the Python Code of this problem with comments added.

#Variables we need to store the data from user.

city = input("Enter the city name: ")

temperature_celcius = float(input("Enter the current temperature in Celcius: "))

#Calculation section by using the formula.

temperature_fahrenheit = (temperature_celcius * 9/5) + 32

#Inform the user.

print(f"The current temperature in {city} is {temperature_celcius}°C, which is {temperature_fahrenheit}°F.")

Help is greatly appreciated! I need a step but step explanation and a startup would-example-1
User Eugene Gavrilov
by
7.4k points