


Name = input("Welkom bij de Magische 8-Ball! Voer uw naam in om te beginnen: ")Īnswer = “Het is een gegeven dat het zo is.”Īnswer = “Dat kan ik je nu beter niet vertellen.”Īnswer = “Het ziet er naar uit van niet.”

This means they will only be executed when the else condition is true. You have aligned it with answer = “Error”. The last 2 lines of codes should not be indented. Instead of printing out the answer in each of the if-elif statement, you should be assigning to the variable answer. But, this else statement will not happen because we force the random_number to be 1 to 9 and these have been taken care in the if-elif statements. The variable answer is only assigned to “Error” in the else statement. Then, it prints “Reply hazy, try again.” After that, the code gets out of the if-elif-else statement and nothing will be printed! The reason you’re getting this is because the random_number = 4. Jose asks: Will I get another dog named Naruto? Is there anything I could be doing better? Question = "Will I get another dog named Naruto?" Whenever I run my code it rearranges the order of the print statement in a manner that doesn’t make sense. I am on learn python 3 Magic 8-Ball section of the course. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer! If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with! Please find the tag relating to the section of the course you are on E.g. You must select a tag to post in this category.
