about syntax errors

I'm practicing python and I'm using python 3.5 32-bit and created the "guessing game" program but continue to get a syntax error :
Here's my code-
import random
print("\tWelcome to 'Guess MY Number'!")
print("\n I'm thinking of a number between 1 and 100.")
print("Try to guess as little as possible.")

the_number = random.randint(1,100)
guess= True
Tries = 0

while guess !=the_number:
  guess = (input("Take a guess"))


  try:
      guess = int(guess)
  except VauleError:
        print("The was not an integer."
  else:
      if guess<1 or guess > 100:
          print("That was not a integer.")
        elif guess > the_number:
            print("Lower...")
        elif guess < the_number:
            print("Higher...")
  tries += 1

print("You guessed it! The number was", the_number)
print("And ou only took", tries,"tries.")

Open in new window

Dwight IvanovAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

phoffric\Commented:
Most code, but especially python, must be inserted using code tags because then it is easier to see the indentation.
Based on your OP code, the indentation appears a little off. But maybe that was just the way you input your data in the OP.

You should copy/paste the exact syntax error into the OP.
phoffric\Commented:
Also, Tries and tries are different tokens. Case sensitive, Python is.
phoffric\Commented:
VauleError - typo.
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

phoffric\Commented:
After correcting indentation, typos, and case sensitive mistakes, your program works fine.
Platform used: VS 2013 Community. Great debugger.
peprCommented:
When observing a syntax error, it can be a bit higher than the reported line. You have a missing closing parenthesis at the line 17.

Use indentation by 4 spaces for one level. The elif... at line 21 and below are indented more that allowed with respect to the line 19. Here is a bit cleaned code:
#!python3

import random
print("\tWelcome to 'Guess MY Number'!")
print("\n I'm thinking of a number between 1 and 100.")
print("Try to guess as little as possible.")

the_number = random.randint(1, 100)
guess = None
tries = 0

while guess != the_number:
   guess = input("Take a guess: ")
   
   try:
       guess = int(guess)
   except ValueError:
       print("That was not an integer.")
   else:
       if guess < 1 or guess > 100:
           print("That was not a integer.")
       elif guess > the_number:
           print("Lower...")
       elif guess < the_number:
           print("Higher...")
   tries += 1

print("You guessed it! The number was", the_number)
print("And ou only took", tries,"tries.")

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gerwin Jansen, EE MVETopic Advisor Commented:
Some more lines for you to look at that contain errors:

!=the_number:
VauleError:
print("The was not an integer."
guess<1
print("You guessed it! The number was", the_number)
print("And ou only took", tries,"tries.")
Dwight IvanovAuthor Commented:
Thank you everyone
Gerwin Jansen, EE MVETopic Advisor Commented:
You're welcome. Since you're new at EE, don't forget to close the question ;)
peprCommented:
You should add the "hash bang" sequence to the very first line like:
#!/usr/bin/env python3

Open in new window

Say the script is named guess_no, then use the command
chmod +x guess_no

Open in new window

The two things together will make your script an executable -- as any other executable utility. That is, you can launch it by simply typing
$ guess_no

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.