Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Syntax Error
#1
Hey all. Just started Fundamentals of Programming 1 at my local community college. I'm on my first homework assignment which is as follows:

Land Calculation.
One acre of land is equivalent to 43,560 square feet. Write a program that asks the user to enter the total square feet in a tract of land and calculates the number of acres in the tract. (Hint: Divide the amount entered by 43,560 to get the number of acres.

I'm getting a syntax error on my variable landSize. No matter what I change the name to it says there's a syntax error. Any help would be appreciated. Thank you.

# Brian Sullivan
# Program - Complete
# This program will calculate the number of acres in a tract of
# land after the user inputs the total square feet of their tract.

# Sets the variable equal to the amount of square feet in one acre.
oneAcre = 43560

# This gets the number of square feet in the user's tract of land.
squareFeet = int(input( "How many square feet is your tract of land? ")

# This calculates the land size in acres.
landSize = squareFeet / oneAcre

# Displays the result to the user.
print( "Number of acres: " + format(landSize, ".2f") )
Reply


Messages In This Thread
Syntax Error - by bsullivan1983 - Jun-06-2017, 02:46 AM
RE: Syntax Error - by wavic - Jun-06-2017, 03:27 AM
RE: Syntax Error - by bsullivan1983 - Jun-06-2017, 03:52 AM
RE: Syntax Error - by Larz60+ - Jun-06-2017, 04:24 AM
RE: Syntax Error - by bsullivan1983 - Jun-06-2017, 04:59 AM
RE: Syntax Error - by wavic - Jun-06-2017, 06:36 AM
RE: Syntax Error - by sparkz_alot - Jun-06-2017, 01:35 PM
RE: Syntax Error - by bsullivan1983 - Jun-06-2017, 03:01 PM
RE: Syntax Error - by wavic - Jun-06-2017, 04:56 PM
RE: Syntax Error - by nilamo - Jun-06-2017, 05:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Shocked School project -- need help with it it says syntax error XPGKNIGHT 6 4,614 Aug-11-2022, 08:43 PM
Last Post: deanhystad
  I'm getting a syntax error very early on in my code and I can't quite figure it out. liloliveoil 1 2,745 Oct-30-2020, 05:03 AM
Last Post: deanhystad
  Unspecified syntax error hhydration 1 2,699 Oct-25-2020, 10:45 AM
Last Post: ibreeden
  Annuity function for school - syntax error peterp 2 2,984 Oct-12-2020, 10:34 PM
Last Post: jefsummers
  Invalid syntax error, where? tucktuck9 2 4,351 May-03-2020, 09:40 AM
Last Post: pyzyx3qwerty
  Raise an exception for syntax error sbabu 8 4,907 Feb-10-2020, 01:57 AM
Last Post: sbabu
  syntax error: can't assign to operator liam 3 5,397 Jan-25-2020, 03:40 PM
Last Post: jefsummers
  Self taught , (creating a quiz) syntax error on my array DarkAlchemyXEX 9 6,147 Jan-10-2020, 02:30 AM
Last Post: ichabod801
  If Statements and Comparisons returns a syntax error DarkAlchemyXEX 2 3,555 Jan-02-2020, 01:25 PM
Last Post: DarkAlchemyXEX
  Syntax Error: Invalid Syntax in a while loop sydney 1 4,938 Oct-19-2019, 01:40 AM
Last Post: jefsummers

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020