Am i not allowed to flashify my code?


hi! there is nothing wrong with my code but am I not allowed to do what my title says?

from random import randint

# Generates a number from 1 through 10 inclusive
random_number = randint(1, 10)

guesses_left = 3
# Start your game!
print "Welcome to the guessing numbers game! If you guess the right number, you win! And if you don't, you lose! Let's start!"
while guesses_left != 0:
    guess = int(raw_input("What is you guess?"))
    if guess == random_number:
        print "You win! The number was ", random_number, "! Here's your Fab prize! The sweet taste of victory! Yup! That's it! You can go now! Enjoy the rest of your day!"
        guesses_left -= 1
        if guesses_left == 0:
            print "Incorrect! Oh NO! You are out of guesses! SO you LOSE! TOO bad! BUT, there is always next time! until then, GOOOOOOOOOD BYE!"
            print "Incorrect! Ouch, there goes a guess! But, Don't give up yet! you still got ", guesses_left, " guesses left! Give it another shot!"


that depends, some exercise are more flexible then others, some exercises allow for a lot of flexibility, so you can improve your code, in some exercises this is more difficult

You can always optimize the code outside the lesson, does that answer your question?


ok, but what am I missing from this lesson?


can you post the exercise url?


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.