Hello all,
I was messing around and trying different things out with the lessons that were given and I have run into an issue. I don’t know what I did wrong and was hoping someone could nudge me in the right direction. Thank you
The if/else temperature lesson, I changed it to this
temperature = input("What is the Temp? ")
if int(temperature) > 75:
print(“It’s warm out side”)
print(“Drink water”)
if int(temperature) < 30:
print(“It is cold take a jacket”)
elif int(temperature):
print(“It’s nice out side”)
print(“Have a Great Day”)
Which worked just fine.
So then I try to simplify it
temperature = input("What is the Temp? ")
msg = “it’s hot” if int(temperature) > 75: “it’s cold” if int(temperature) < 30: “it’s nice” elif int(temperature):
print(msg)
and I keep getting a problem
{
“resource”: “/d:/Users/jamie/Documents/hello world/app3.py”,
“owner”: “python”,
“code”: “syntax-error”,
“severity”: 8,
“message”: “invalid syntax (, line 2)”,
“source”: “pylint”,
“startLineNumber”: 2,
“startColumn”: 43,
“endLineNumber”: 2,
“endColumn”: 43
}
What did I do wrong? I am uber new at this so please forgive my ignorance.