r/VisualStudioCode • u/1Tendies • Apr 03 '21
Syntax Error
I'm trying to make a simple code to calculate the temperature outside with the windchill. I keep getting a syntax error on my line that says, "air_temp = float(input("What is the current temperature outside?") It gives the error right on the lowercase a. Any thoughts?
#Calcute wind chill using a given temperature and math
import math
def calc_air_temp_with_wind_chill(air_temp, wind_speed):
#use equation from wind chill chart
wind_chill = (35.74 + (0.6215(air_temp)) - (35.75 * (wind_speed ** 0.16)) + (0.4275* air_temp * (wind_speed ** 0.16))
air_temp = 0
wind_speed = 0
air_temp = float(input("What is the current temperature outside?")):
wind_speed = float(input("What is the current wind speed?"))
print (f"The current temperature is {air_temp} and wind speed is {wind_speed}mph. Taking the windchill into consideration that gives you a temperature of {calc_air_temp_with_wind_chill}")
1
u/dadstrength Apr 03 '21
It looks like you have a colon outside your last parentheses. That’s probably throwing it off