VERY Basic Program -- Need Help

This is the place for queries that don't fit in any of the other categories.

VERY Basic Program -- Need Help

Postby mrstat » Wed Jan 15, 2014 4:29 am

Hey guys, here's a problem I'm having while trying to learn Python...

Code: Select all
#Write a program that asks for two numbers. If the sum of the numbers is greater than 100, print "That is a big number."
print("I want two numbers...")
number1 = int(input("First number: ")
number2 = int(input("Second number: ")             

if number1 + number2 > 100:
              print('That is a big number.")
                   


For whatever reason, I get a syntax error when I try to run this program. I saved everything in the proper format (.py) and have no idea why this program fails to run. This is the error message:

Image

Any help would be greatly appreciated! Thank you.
Last edited by micseydel on Wed Jan 15, 2014 5:03 am, edited 1 time in total.
Reason: First post lock.
mrstat
 
Posts: 1
Joined: Wed Jan 15, 2014 4:23 am

Re: VERY Basic Program -- Need Help

Postby micseydel » Wed Jan 15, 2014 5:11 am

On line 3 you're missing a close parenthesis. Weird syntax errors are often a missing closing character, either a quote, paren, bracket or what have you.

Kudos for making a good first post by the way. The screenshot wasn't necessary but it didn't hurt!
Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.
User avatar
micseydel
 
Posts: 1358
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: VERY Basic Program -- Need Help

Postby zeycus » Wed Jan 15, 2014 8:24 am

There is also a small problem with the last print. The string is written as:
Code: Select all
'That is a big number."

You opened it with one delimiter, and closed with the other, which is not legal. You can choose between the single or double quote for delimiting strings, but in the same string you need to be consistent.
Image

Live long and prosper.
Spock
User avatar
zeycus
 
Posts: 23
Joined: Sun Feb 17, 2013 10:30 am
Location: Madrid


Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 4 guests