[Tutor] why do i keep getting syntax errors in python when this runs

Prasad, Ramit ramit.prasad at jpmorgan.com.dmarc.invalid
Fri Sep 6 20:53:15 CEST 2013


Joel Goldstick wrote:
> On Fri, Sep 6, 2013 at 12:27 AM, mike johnson <pretorian at hotmail.com> wrote:
> > can you please help me figure out why this isnt working thanks
> 
> You have tthree problems:
> 
> > # convert.py
> > # this program is used to convert Celsius temps to Fahrenheit
> > # By: James Michael Johnson
> >
> > Def main ():
> 
> The keyword is def, not Def, so rewrite like:
> def main():
> 
> > Celsius = float (input ("What is the Celsius temperature? "))
> > Fahrenheit = 9.0 / 5.0 * Celsius + 32
> > Print ("The temperature is ", Fahrenheit, " degrees Fahrenheit.")
> >
> >
> You have not indented the suite of code that runs in main, so set your
> editor to print 4 spaces when tab is pressed, and tab each line under
> main.
> 
> 
> > Main ()
> 
> 
> You defined main() but you called Main.  Python is case sensitive, so
> change this to main()

It should also be "print" and not "Print".


~Ramit



This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email.  


More information about the Tutor mailing list