We help IT Professionals succeed at work.
Get Started

about syntax errors

Last Modified: 2017-01-30
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"))

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

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

Open in new window

Watch Question
This problem has been solved!
Unlock 6 Answers and 9 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE