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

Luke Pettit petluke at gmail.com
Sat Sep 7 10:34:09 CEST 2013


def main ():
Celsius = float (input ("What is the Celsius temperature? "))
Fahrenheit = 9.0 / 5.0 * Celsius + 32
print("The temperature is ", Fahrenheit, " degrees Fahrenheit.")
main()

You need to check your capitalisation on all the basic things for a start

# def main() Def?
# then you call it with Main()?


On 7 September 2013 17:09, James Griffin <jmz at kontrol.kode5.net> wrote:

> !-- On Fri  6.Sep'13 at  5:27:23 BST, mike johnson (pretorian at hotmail.com),
> wrote:
> > can you please help me figure out why this isnt working thanks
> > # convert.py
> > # this program is used to convert Celsius temps to Fahrenheit
> > # By: James Michael Johnson
> >
> > Def main ():
> > Celsius = float (input ("What is the Celsius temperature? "))
> > Fahrenheit = 9.0 / 5.0 * Celsius + 32
> > Print ("The temperature is ", Fahrenheit, " degrees Fahrenheit.")
> >
> >
> > Main ()
>
> [ ...]
>
> > # convert.py
> > # this program is used to convert Celsius temps to Fahrenheit
> > # By: James Michael Johnson
> >
> > Def main ():
> > Celsius = float (input ("What is the Celsius temperature? "))
> > Fahrenheit = 9.0 / 5.0 * Celsius + 32
> > Print ("The temperature is ", Fahrenheit, " degrees Fahrenheit.")
> >
> >
> > Main ()
>
> I'm sure this is homework. I had a peice of homework in my first year
> Undergrad exactly like this.
>
> --
>
>
> James Griffin: jmz at kontrol.kode5.net
>
> A4B9 E875 A18C 6E11 F46D  B788 BEE6 1251 1D31 DC38
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>



-- 
Luke Pettit ,,, ^..^,,,
http://lukepettit-3d.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130907/779ede2d/attachment.html>


More information about the Tutor mailing list