Avatar of Dwight Ivanov
Dwight Ivanov

asked on 

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

JavaProgrammingPythonLinuxProgramming Languages-Other

Avatar of undefined
Last Comment
pepr
SOLUTION
Avatar of phoffric
phoffric

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of phoffric
phoffric

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of phoffric
phoffric

VauleError - typo.
SOLUTION
Avatar of phoffric
phoffric

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
ASKER CERTIFIED SOLUTION
Avatar of pepr
pepr

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
SOLUTION
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Dwight Ivanov
Dwight Ivanov

ASKER

Thank you everyone
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

You're welcome. Since you're new at EE, don't forget to close the question ;)
SOLUTION
Avatar of pepr
pepr

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Java
Java

Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.

102K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo