Python Error - help please

What am I missing??

  File "", line 10
    print "There are", cars, "cars available."
SyntaxError: invalid syntax

The code:

cars = 100
space_in_car = 4.0
drivers = 30
passengers = 90
cars_not_driven = cars - drivers
cars_driven = drivers
carpool_capacity = cars_driven * space_in_a_car
average_passengers_per_car = passengers / cars_driven

print "There are", cars, "cars available."      
print "there are only", drivers, "drivers available."
print "There will be", cars_not_driven, "empty cars today"
print "We can transport", carpool_capacity, "people today."
print "We have", passengers, "to carpool today."
print "We need to put about", average_passengers_per_car, "in each car."

python version info:

Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:19:30) [MSC v.1600 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
amigan_99Network EngineerAsked:
Who is Participating?
amigan_99Connect With a Mentor Network EngineerAuthor Commented:
I found it..  It's a Python v2 vs v3 problem..

Old: print "The answer is", 2*2
New: print("The answer is", 2*2)
amigan_99Network EngineerAuthor Commented:
Now it runs correctly:

There are 100 cars available.
there are only 30 drivers available.
There will be 70 empty cars today
We can transport 120.0 people today.
We have 90 to carpool today.
We need to put about 3.0 in each car.
amigan_99Network EngineerAuthor Commented:
It is what it is.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.