[Tutor] Help with elif
kent37 at tds.net
Sun Jan 18 04:44:25 CET 2009
On Sat, Jan 17, 2009 at 10:21 PM, Ian Egland <echolynx at gmail.com> wrote:
> I have looked at a couple tutorials and whipped this up. However, attempting
> to run it in IDLE results in a syntax error leaving my elif highlighted in
> red. What's wrong? I've looked at the code and can't find any syntax errors-
> though I've just started.
> print("[Temperature Converter, First Edition]")
> print("Created on January 17th, 2009 by Ian Egland")
> temp1 = int(input("Please enter a temperature: "))
> scale = input("Convert to (F)ahrenheit or (C)elcius?")
> if scale == "F":
> temp2 = (9/5)*temp1+32
> print(temp1, "C =", temp2, "F"
Missing parenthesis in the above line.
> elif scale == "C": # Error appears here.
Syntax errors often appear on the line *following* the line with the
More information about the Tutor