Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- city = "Seoul"
- high_temperature = 18
- low_temperature = 9
- temperature_unit = "degrees Celsius"
- weather_conditions = "light rain"
- #todo rewrite this line to use the format method rather than string concatenation
- #alert = "Today's forecast for " + city + ": The temperature will range from " + str(low_temperature) + " to " + str(high_temperature) + " " + temperature_unit + ". Conditions will be " + weather_conditions + "."
- alert = "Today's forecast for {}: The temperature will range from {} to {} {}.\nConditions will be {}.".format(city, str(low_temperature), str(high_temperature), temperature_unit, weather_conditions)
- # print the alert
- print(alert)
Add Comment
Please, Sign In to add comment